User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 375,174 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,192 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1618 | Replies: 3
Reply
Join Date: Aug 2005
Posts: 20
Reputation: cppforlife is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
cppforlife cppforlife is offline Offline
Newbie Poster

Simple number...

  #1  
Aug 31st, 2005
Everyone knows yahoo mail. When you just logged on to your account you see on the page "You have 0 unread messages". I just womdered is there any way how can i find something on the page using javascript and return as variable. So what i've done is:

1. I have a frame with src="http://mail.yahoo.com"
2. every 10 seconds it refreshes iframe

Now i need to find in the content of iframe that "simple number" and display it on the title.
Example @ http://www.geocities.com/cppforlife/...tml/yahoo.html

thanks everyone...
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Simple number...

  #2  
Aug 31st, 2005
You cannot do this client-side, because that would mean a script from your domain would need access to the contents of a page from another domain, and browsers don't allow that. You'll need to use a server-side language to perform what's called "screen scraping". I found this discussion on client-side scraping: http://ask.metafilter.com/mefi/23180
Reply With Quote  
Join Date: Aug 2005
Posts: 20
Reputation: cppforlife is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
cppforlife cppforlife is offline Offline
Newbie Poster

Re: Simple number...

  #3  
Aug 31st, 2005
Thank you for answer but i am not sure because i saw somewhere it.
you can call predefined function find like (ctrl+f) and it will return result.
then you look at the result and take it. sounds easy but how to do that. i am sure i saw that method somewhere ...

Thanks

-------------------------
Also i dont know what's it . Is it bug in IE. Sometimes(if i ususally open page it works but when i refresh it it gives me error) when set interval to 1 milisecond (setInterval("func()", 1)) browser gives me error 'getElementById is null or not an object'.

|
\/

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
  <title>Progress Bars</title>

<script>
var curr=0;
var curr1=1;
var max=8;
var str="";
function add(){
     curr++;
     str=str.concat("");
     document.getElementById('pb').innerHTML="<b>"+str+"</b>    "+curr;
}

var count=setInterval("add()", 3000);

function add1(){
     curr1++;
     document.getElementById('pb1').style.width=curr1;
}

function clearAll(){
   clearInterval(count);
   clearInterval(count1);
}

var count1=setInterval("add1()", 100);
setTimeout("clearAll()", 200000);
</script>
</head>

<body>

<div name=pb id=pb style="border: 1px solid blue; height: 20px" valign=center></div>

<div style="position: absolute; left: 120px; top: 90px; background-color: red; width: 1px; height: 20px" name=pb1 id=pb1></div>

</body>
</html>

very useful thing that progress bars...

Thanks again
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Simple number...

  #4  
Aug 31st, 2005
A 1ms interval? Yes, I'd imagine that would cause problems. Either it isn't enough time for your function to run, or the element hasn't been rendered yet.

Sorry, you can't run cross-domain scripts. You're welcome to keep searching and correct me if I'm wrong (it won't be the first time!), but your best bet really is to do server-side screen scraping.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 12:09 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC