| | |
how to figer out the page is rendered by the browser
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2008
Posts: 1
Reputation:
Solved Threads: 0
Hi,
I am working on the application in which Ajax, JSP, Javascript and html is used in UI part. We have our own UI frame work in which we update the page through AJAX. i.e. Initially page is loaded and later on we request to AJAX to update that particular page. But here page is updated without refreshing or reloading.
Requirement: Requirement is when the page is updated I have to make one button disable on that page.
Problem: I can make the button disable on 'onload' event of that page which get calls when the page is refreshed or reloaded. But as ajax update the page without refreshing/reloading the page, I am not able to get the event 'onload' and so I can not call the method which disable that particular button.
Is there any other way to work ? or
Is there any function of javascript which will be called automatically once the page is updated with refreshing?
Let me know if you need more information on this,
Thanks
Chandan
I am working on the application in which Ajax, JSP, Javascript and html is used in UI part. We have our own UI frame work in which we update the page through AJAX. i.e. Initially page is loaded and later on we request to AJAX to update that particular page. But here page is updated without refreshing or reloading.
Requirement: Requirement is when the page is updated I have to make one button disable on that page.
Problem: I can make the button disable on 'onload' event of that page which get calls when the page is refreshed or reloaded. But as ajax update the page without refreshing/reloading the page, I am not able to get the event 'onload' and so I can not call the method which disable that particular button.
Is there any other way to work ? or
Is there any function of javascript which will be called automatically once the page is updated with refreshing?
Let me know if you need more information on this,
Thanks
Chandan
Am not sure if this wil solve the issue. But this may come in handy...
This will allow you to add function() calls once the page is loaded!
It's ideal for use in scripts that may be executing along side other scripts that have already been registered to execute once the page has loaded.
This will allow you to add function() calls once the page is loaded!
It's ideal for use in scripts that may be executing along side other scripts that have already been registered to execute once the page has loaded.
html Syntax (Toggle Plain Text)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Some Title</title>
javascript Syntax (Toggle Plain Text)
<script type="text/javascript"> <!-- BEGIN HIDING function newLoadEvent( _function ) { var _onload = window.onload; if ( typeof window.onload != 'function' ) { window.onload = _function; } else { window.onload = function() { if ( _onload ) { _onload(); } _function(); } } } /* Name of some function() to run on page load *///----> newLoadEvent( example ); function example() { document.getElementById('sample').innerText = 'Hello World!'; } /* More function() to run on page load *///-----> newLoadEvent( function() { /* More code to run on page load */ alert('Hello World!'); } ); /* The 3rd function() to run on page load and so on... *///----> newLoadEvent( function() { document.getElementById('sample1').innerHTML = document.title; } ); // DONE HIDING --> </script>
html Syntax (Toggle Plain Text)
</head> <body> <p> <span id="sample"></span> <br /> <span id="sample1"></span> </p> </body> </html>
Dev.Opera — FOLLOW THE STANDARDS, BREAK THE RULES...
•
•
Join Date: Aug 2008
Posts: 381
Reputation:
Solved Threads: 33
Hi,
It's true that most elements do not support the onload event ... the window does and images do too.
I have yet to find a browser that loads content other than top to bottom, so you could effectively include a tiny-invisible-gif image at the very end of you dynamically loaded content and give it an onload event to call the javascript function that disables your button.
Hope this helps
It's true that most elements do not support the onload event ... the window does and images do too.
I have yet to find a browser that loads content other than top to bottom, so you could effectively include a tiny-invisible-gif image at the very end of you dynamically loaded content and give it an onload event to call the javascript function that disables your button.
Hope this helps
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<html> <head> <script type="text/javascript"> function loaded ( target ) { alert( target.parentNode.id ); } </script> </head> <body> <div id="test"> <img src="one.gif" onload="loaded(this)" /> </div> </body> </html>
Google is the answer to all of your questions -- the trick is knowing what question to ask in your specific predicament.
![]() |
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: The code looks right but does not work.
- Next Thread: Radio Button - AJAX - Problem with Passing Value
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp animate array automatically beta box bug calendar cart checkbox class codes column cookies createrange() css cursor date debugger decimal design dom download dropdown editor element embed enter error events explorer firefox focus frameworks getselection google gwt hint html htmlform ie7 iframe images index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jsp listbox maps masterpage math menu microsoft mimic mp4 object onmouseover parent paypal php player position post problem programming progressbar prototype redirect regex runtime safari scale scriptlets search select session shopping size sql text textarea toggle variables w3c webservice website window windowofwords windowsxp wysiwyg





