473,471 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Track the response status of a IFrame

dmjpro
2,476 Top Contributor
I have an IFrame in my page. From this i running a script to load the IFrame and to track whether the IFrame gets loaded properly or not.
How can i track this ...can anyone help me to do this. .. ?
Oct 22 '08 #1
24 15796
acoder
16,027 Recognized Expert Moderator MVP
Use the onload event.
Oct 22 '08 #2
dmjpro
2,476 Top Contributor
Use the onload event.
Yeah that i thought and tried to do but failed ....
Basically the IFrame is getting updated asynchronously by Ajax ..what should i be doing ?
Oct 22 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
Post the code that you're testing with.
Oct 22 '08 #4
gits
5,390 Recognized Expert Moderator Expert
an analogue thing to an onload-event is the callback of an async AJAX-request ... this is called (you may consider it as 'fired' if you like) when the response is ready to use ...

kind regards
Oct 22 '08 #5
dmjpro
2,476 Top Contributor
an analogue thing to an onload-event is the callback of an async AJAX-request ... this is called (you may consider it as 'fired' if you like) when the response is ready to use ...

kind regards
Ok let me explain ....
I am testing the code with site Orkut .....
There is an IFrame and Iframe is getting loaded by asyn Ajax call. All these are taking care of by site itself ..i am running a script outside of this ...i have no control over the JS code of the site .....How can i track the response status when IFrame gets loaded successfully ... Is it possible ... ????
Oct 23 '08 #6
acoder
16,027 Recognized Expert Moderator MVP
Is the site loaded into the iframe from the same domain?
Oct 23 '08 #7
rnd me
427 Recognized Expert Contributor
if the iframe is in a different domain than the html page pointing to/containing your script, then no.
Oct 23 '08 #8
dmjpro
2,476 Top Contributor
if the iframe is in a different domain than the html page pointing to/containing your script, then no.
No no ..this is the same domain .....
Oct 23 '08 #9
acoder
16,027 Recognized Expert Moderator MVP
Post your code or a link to a test page. Can you get the response from the Ajax call? How did you use the onload event?
Oct 23 '08 #10
dmjpro
2,476 Top Contributor
Post your code or a link to a test page. Can you get the response from the Ajax call? How did you use the onload event?
I am not using onLoad event because page is loaded by Ajax Call.
And one more thing do you have any Orkut Account only then i can do further communication with you ... ;)
Oct 23 '08 #11
acoder
16,027 Recognized Expert Moderator MVP
No, I don't have an Orkut account.

Why can't you post the JavaScript code that you're using? If it's loaded using Ajax, why not use the status property (OK) to mean that it's loaded? If it takes a long time to load, you can still set the onload event by accessing the iframe. You could also check the document exists.
Oct 23 '08 #12
dmjpro
2,476 Top Contributor
No, I don't have an Orkut account.

Why can't you post the JavaScript code that you're using? If it's loaded using Ajax, why not use the status property (OK) to mean that it's loaded? If it takes a long time to load, you can still set the onload event by accessing the iframe. You could also check the document exists.
The Ajax function is taken care by Orkut itself ...i can't interfere the code ...I think without touching it's Ajax call back function i can't track the status OK.
Anyway ..this is my code ......


Expand|Select|Wrap|Line Numbers
  1. javascript:var _win=window.frames['orkutFrame'];var doc = window.frames['orkutFrame'].document;if(typeof top.win!='undefined' && !top.win.closed) top.win.focus();else top.win = window.open('','win_1234567890','height='+screen.height+',width='+screen.width+',menubar=no,location=no,resizable=yes,scrollbars=yes,status=no');image = top.win.document.createElement('img');image.src = doc.getElementById('m1224670822579').src;top.win.document.body.appendChild(image);while(1)if(doc.getElementById('nav_right').src.indexOf('disable')==-1){_win.galleryManager.next();alert('press OK, when next pic loaded..');image = top.win.document.createElement('img');image.src = doc.getElementById('m1224670822579').src;top.win.document.body.appendChild(image);}else break;void(0);
See ... i have an alert box ....i have to press OK until the next page loaded into the IFrame. Here i am unable to track the loading status of the IFrame .....
This is my problem ... ;)
Oct 23 '08 #13
acoder
16,027 Recognized Expert Moderator MVP
Why can't you add an onload, e.g.
Expand|Select|Wrap|Line Numbers
  1. window.frames['orkutFrame'].onload= function() {...}
or use addEventListener/attachEvent if you already have an onload.

Another alternative is to check periodically for the existence of the document using the technique in an earlier thread of yours - Accessing elements of an iframe.
Oct 23 '08 #14
rnd me
427 Recognized Expert Contributor
The Ajax function is taken care by Orkut itself ...i can't interfere the code ...I think without touching it's Ajax call back function i can't track the status OK.
why can;t you change orkut's code? you said it was running the same domain as you are. i clobber this's site vBulletin code in my greasmonkey scripts...

simple copy thier function, modify it, and load it with your script. do it before onload, and use window["globalName"] style syntax to over-rule the existing code.
Oct 23 '08 #15
dmjpro
2,476 Top Contributor
Why can't you add an onload, e.g.
Expand|Select|Wrap|Line Numbers
  1. window.frames['orkutFrame'].onload= function() {...}
or use addEventListener/attachEvent if you already have an onload.

Another alternative is to check periodically for the existence of the document using the technique in an earlier thread of yours - Accessing elements of an iframe.
Acoder one thing clarify me ...that if a page gets loaded using Ajax then OnLoad events gets fired or not ..i think not .....and here the IFrame gets loaded using Ajax.
And did mean 'Periodically' ..... should i use 'interval'?
Oct 24 '08 #16
dmjpro
2,476 Top Contributor
why can;t you change orkut's code? you said it was running the same domain as you are. i clobber this's site vBulletin code in my greasmonkey scripts...

simple copy thier function, modify it, and load it with your script. do it before onload, and use window["globalName"] style syntax to over-rule the existing code.
I am running a code from Orkut not from my domain. If i could know that which page gets called to load the IFrame then there would no problem ..i could have written my Ajax function any way i think it's not possible to track the status of a page when it gets loaded using AJax. :(
Oct 24 '08 #17
acoder
16,027 Recognized Expert Moderator MVP
Acoder one thing clarify me ...that if a page gets loaded using Ajax then OnLoad events gets fired or not ..i think not .....and here the IFrame gets loaded using Ajax.
If it's getting loaded, then why not?
And did mean 'Periodically' ..... should i use 'interval'?
Yes, setInterval.
Oct 24 '08 #18
acoder
16,027 Recognized Expert Moderator MVP
I am running a code from Orkut not from my domain. If i could know that which page gets called to load the IFrame then there would no problem ..i could have written my Ajax function any way i think it's not possible to track the status of a page when it gets loaded using AJax. :(
Why can't you check the source code? Use firebug to make things easier.
Oct 24 '08 #19
dmjpro
2,476 Top Contributor
Why can't you check the source code? Use firebug to make things easier.
Did you ever check out the source code of Orkut ...those are generated code ...
Actually Google uses GWT for better web development with Ajax.
So it's not easier to understand their source code ...what do you mean by FireBug?


And one more thing ..... setInterval is stupid solution, it also struck my mind ......but ... :(
Oct 24 '08 #20
acoder
16,027 Recognized Expert Moderator MVP
You can see the generated source code using the Web Developer/Firebug Firefox extensions. Seek and you shall find...

PS. is this what you're working on?
Oct 24 '08 #21
dmjpro
2,476 Top Contributor
You can see the generated source code using the Web Developer/Firebug Firefox extensions. Seek and you shall find...

PS. is this what you're working on?
No no i am not in this ..... just i am simply doing funs with Orkut ......


Hey Acoder what a fantastic thing ....the Firebug is interesting i think now it would be easier to solve ;)
Oct 24 '08 #22
acoder
16,027 Recognized Expert Moderator MVP
No no i am not in this ..... just i am simply doing funs with Orkut
If you are, then wouldn't you be writing an app for it? Orkut docs
Hey Acoder what a fantastic thing ....the Firebug is interesting i think now it would be easier to solve ;)
Yes, I think we can agree on that one :)
Oct 24 '08 #23
dmjpro
2,476 Top Contributor
If you are, then wouldn't you be writing an app for it? Orkut docs
Yes, I think we can agree on that one :)
Ok thanks ....!!!

But one problem is there ... how to track the actual code when an event gets fired ..is that possible to track using FireBug.
I can track the element in the FireBug...i mean i can do inspection in FireBug ..but can not track the actual code of an event event handler .. :(
Oct 24 '08 #24
rnd me
427 Recognized Expert Contributor
Ok thanks ....!!!

I can track the element in the FireBug...i mean i can do inspection in FireBug ..but can not track the actual code of an event event handler .. :(
sure you can. try one of the two DOM tabs (full or element).
Oct 24 '08 #25

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Dica | last post by:
i've got a client that wants to be able to review records about IIS generated emails. in his own words, he wants the "ability to track and report message status (i.e. how many messages were sent...
1
by: Asha | last post by:
greetings, i'm using an iframe <iframe id="iFrame" runat="server" src="SC_Ext_Rpt.aspx" width="775px" height="900px" frameborder="no"> </iframe> and in my file SC_Ext_Rpt.aspx, if i were to...
4
by: Stu | last post by:
Hi, I need to push a .eml file (MS email pickup format) to the browser when the user clicks on a button. The file is outside of the web space so I used this method (which worked with word docs)....
0
by: adzgarbage | last post by:
The problem this fixes is where you put some content in an iframe and the content finishes loading in the iframe but the ie status bar keeps loading. I had this problem for quite a while, here is...
4
by: Amuthaangler | last post by:
Hi all, I am currently working with Iframe which holds the JSON response from the server once when the picture gets uploaded successfully. Now I need to parse the JSON response and retrieve...
2
by: Robert Bravery | last post by:
HI All, I have an Ifame on my page. I have retrieved a page response from a server like: string response = Encoding.UTF8.GetString(responseBytes); HtmlControl frame1 =...
1
vanc
by: vanc | last post by:
I'm playing with Content Master page and in the Content page I've put in a iFrame, yeah I know people is saying that iFrame is evil but hey, I need this thing to load a external site. Anyway,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.