| | |
how to reload a page using javascript with out alert
Please support our JavaScript / DHTML / AJAX advertiser: 50% off 6 Months Dedicated Server Hosting from 1&1!
Thread Solved |
•
•
Join Date: Mar 2008
Posts: 12
Reputation:
Solved Threads: 2
•
•
•
•
hi,
iam using the following javascript a page
opener.location.reload( true );
but every time the page reloads iam a getting alert message.
How can i reload a page with out a alert message
Could be that your posting data to the page and then trying to refresh it?
Green2go
i have two pages one is parent page and other child page.when i click on hyperlink in parent page,the child page should open and on clicking submit button in child page,the page should close and reload the parent page.Thats y iam using opener.location.reoload(true).
iam getting the follwong error
"The page cannot be refreshed without resending the information.click retry to send the information again,or click cancel to return to the page that you were trying to view."
iam getting the follwong error
"The page cannot be refreshed without resending the information.click retry to send the information again,or click cancel to return to the page that you were trying to view."
If u r query is achieved,mark the thread as solved
Live and Let Live
Live and Let Live
•
•
Join Date: Aug 2008
Posts: 383
Reputation:
Solved Threads: 35
That alert is basically stating that you submitted a form and by reloading the page you are going to resubmit the same data from the form (again).
This might work to not reload the page but reload the location ... let me know if it works
Cheers
This might work to not reload the page but reload the location ... let me know if it works
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
window.location.href = window.location.href; // or ... window.location.href = 'same_page.html';
Cheers
Basically my need is when a click edit button in parent page,i need to open a child page . After filling the data in the child page and clicking submit in child page,the child page should close and update the parent page.
When i use as u stated location.href, the page is not getting updated.
When i use as u stated location.href, the page is not getting updated.
If u r query is achieved,mark the thread as solved
Live and Let Live
Live and Let Live
•
•
Join Date: Aug 2008
Posts: 383
Reputation:
Solved Threads: 35
I think I see what you're trying to do now.
parent.html
pup.html
I think something like this is what you're looking for ... let me know if it works for you.
:-)
parent.html
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<html> <head> <script type="text/javascript"> // open your pop-up window ... var pup = window.open('pup.html','pup'); function populate_form ( val1, val2 ) { pup.close(); var form = document.getElementById('my_form'); for ( var i = 0; i < form.elements.length; i ++ ) { var element = form.elements.item(i); switch ( element.name ) { case 'field_1': element.value = val1; break; case 'field_2': element.value = val2; break; } } } </script> </head> <body> <form id="my_form"> <input type="text" name="field_1" /> <input type="text" name="field_2" /> </form> </body> </html>
pup.html
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<html> <head> <script type="text/javascript"> function send_to_parent ( target ) { var val1 = target.getAttribute('val1'); var val2 = target.getAttribute('val2'); opener.populate_form( val1, val2 ); return false; } </script> </head> <body> <a href="javascript:" val1="one" val2="two" onClick="send_to_parent(this)">Populate 'one','two'</a><br /> <a href="javascript:" val1="three" val2="four" onClick="send_to_parent(this)">Populate 'three','four'</a> </body> </html>
I think something like this is what you're looking for ... let me know if it works for you.
:-)
•
•
Join Date: Aug 2008
Posts: 383
Reputation:
Solved Threads: 35
•
•
•
•
hi,
Thanks for the quick reply,but i want to update the whole page.
parent.php (parent file name)
child.html
html Syntax (Toggle Plain Text)
<head> <script type="text/javascript"> window.onload = function () { var form = document.getElementById('child_form'); form.onsubmit = function () { self.close(); }; }; </script> </head> <body> <form id="child_form" action="parent.html" method="POST"> ... form input goes here </form> </body>
Then in the parent window you will need to detect if it is getting form values passed to it
php Syntax (Toggle Plain Text)
<?php if ( count( $_POST ) ) { // grab all the posted values here $val1 = $_POST ['val1']; // etc ... } ?> <html> <head> </head> <body> ... update the parent with child values <input type="text" name="val1" value="<? print $val1 ?>" /> ... or whatever values you need to update on the parent page ... using inline <? print $value ?> PHP tags </body> </html>
Hope this makes sense
![]() |
Similar Threads
- XML Bug Error. (XML, XSLT and XPATH)
- getElementsByName() generates undefined ouput value in a textbox (JavaScript / DHTML / AJAX)
- upload file using jsp and mysql (JSP)
- AJAX generated <select> and FIREFOX (JavaScript / DHTML / AJAX)
- Is session will work if cookies are disbaled on clinet side? (PHP)
- Please Help in JavaScript Problem (JavaScript / DHTML / AJAX)
- Need help with Javascript (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Ajax - Fetching Records from DB
- Next Thread: Delay on Mouse Out
Views: 9965 | Replies: 12
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
8 ad ajax ajaxcode ajaxhelp ajaxjspservlets animate api array asp asp.net autoplay box boxes bug captchaformproblem catch close code content cookies css date dependent design div dom draganddrop dropdown dynamic element embed error eventhandlers events explorer ext file firefox firehose flash focus font form forms function gears google gxt hide html ie7 iframe image image() internet internet-explorer java javascript javascripts jquery js libcurl lists load maps modal mp4 mysql onclick onmouseover parameters paypal php player position post resize reveal script scroll scrubber search select show simple size smarty source sources text textbox twitter unicode validation variables web webkit window xml





