|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
How do I get url from status bar?
Hi All
How do I get url from status bar? Assume as I have iframe and then when I click link in iframe I want the textbox in parent page will show the url from the link. Can u help me ? |
|
#2
|
||||
|
||||
|
Here's kind of a sloppy example... I don't see much use in this, but I'm sure you have a reason =)
main.htm Code:
<HTML> <HEAD> <TITLE>Example</TITLE> </HEAD> <BODY> URL: <input type="text" id="show_here" /><br /> <iframe src="inside.htm" id="testiframe" name="testiframe" width="80%" height="60%"></iframe> </BODY> </HTML> inside.htm Code:
<HTML>
<HEAD>
<TITLE>Test</TITLE>
<script type="text/javascript">
function showUrl(url) {
parentText = parent.document.getElementById('show_here');
parentText.value = url;
}
</script>
</HEAD>
<BODY>
<a href="http://www.msn.ca" onclick="showUrl(this.href);">MSN</a><br />
<a href="http://www.yahoo.ca" onclick="showUrl(this.href);">Yahoo</a><br />
<a href="http://www.google.ca" onclick="showUrl(this.href);">Google</a><br />
</BODY>
</HTML>
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#3
|
|||
|
|||
|
many Thx MadCowDzz for the code but in my case the page
in iframe is external domain (ie google.com) if it possible to do please help me again. thx a lot. ![]() |
|
#4
|
||||
|
||||
|
you mean you have a webpage say your domain is freewebs.com and subdomain is coder...
mainfile: http://www.freewebs.com/coder/main.html iframe: http://www.myspace.com/ ? if it is like that i have no clue how to get the link unless it is displayed in the window.status from the external iframe... if it is displayed from the external iframe into the window.status, you can check with this... Code:
// depending on an imported string, this will search for http:// or www. to look for a website.
function isURL(sorze) {if ((sorze.search("http://")!=-1) || (sorze.search("www.")!=-1)) {if (sorze.search("http://")!=-1) { alert("is a http:// website at character: "+sorze.search("http://"));}else if (sorze.search("www.")!=-1) { alert("is a www. website at character: "+sorze.search("www."));}}
}
if you want me to complete this code i could try and have it get the full domain it is displaying... otherwise, if you are trying to access the link directly, it is a security feture that you do not have permission to access other websites coding, or ajust other websites coding with javascript. you could get the current text of the window.status by simply Code:
var stat=window.status; alert(stat); hope this helped, colton22 ps: PM me for my email if you want to contact me by email. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > How do I get url from status bar? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|