jquery - Send post data to iframe and reload the iframe -


i tried something using jquery, failed.

$.ajax({ type: "post", url: "myphphere.php", data: { command: $('#command').var() } });

i thought refreshing page using onclick attribute of button submit form.

why use target attribute in form?

<form action="..." target="an_iframe" type="post"> <input type="text" name="cmd" placeholder="type command here..." /> <input type="submit" value="run!" /> </form> <iframe id="an_iframe"></iframe> 

hope solved problem.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -