/    Sign up×
Community /Pin to ProfileBookmark

Help with script please…

Hello,

I have recently found a script I would like to use. If that’s not too much trouble then please try this script to see what it does and please tell me how can I make it compatible with other browsers other than IE. Or could you please give me another script like that one which is compatible at least with a couple of other major browsers.

It works perfectly on IE. I have tested it on Firefox also, and it didn’t work…

Thank you in advance.

[CODE]<html>

<HEAD>

<SCRIPT LANGUAGE=”JavaScript”>

<!– Begin
function writeLayer(text) {
document.frames[‘myFrame’].location.href = text;
document.addrForm.location.value = text;
}
function setLayer(text) {
if (text.indexOf(“http://”,0) <= 0)
text = “http://” +text;
document.frames[‘myFrame’].location.href = text;
document.addrForm.location.value = text;
}
function onLoad(text) {
if (text != “Microsoft Internet Explorer”) {
alert(“netscape not supported”);
history.back();
}
return true;
}
// End –>
</script>

</HEAD>

<BODY onLoad=”onLoad(navigator.appName)”>

<iframe src=”about:blank” width=100% height=90% id=myFrame></iframe>
<center>
<form name=addrForm>
<input type=button value=”Google” onClick=”writeLayer(‘http://www.google.com’)”>
<input type=button value=”Yahoo” onClick=”writeLayer(‘http://www.yahoo.com’)”>
<input type=button value=”etc…” onClick=”writeLayer(‘about:blank’)”>
Location:
<input type=text name=location value=”Type any URL here then press Go” onFocus=”this.value=”” size=35>
<input type=button value=”Go” onClick=”setLayer(document.addrForm.location.value)”>
</form>
</center>

</body>

</html>[/CODE]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@forty2Jan 06.2007 — <i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;New Document&lt;/title&gt;
&lt;script type="text/javascript"&gt;
function FrameRedirect(addres) {
var ele=document.forms['root'].elements['location'];
var url=(!addres) ? ele.value : addres;

<i> </i> frames['myFrame'].location.href=url;
<i> </i> ele.value=url;
<i> </i> }
<i> </i> &lt;/script&gt;
<i> </i>&lt;/head&gt;
<i> </i>&lt;body&gt;
<i> </i> &lt;iframe src="about:blank" name="myFrame" width="100%" height="90%"&gt;&lt;/iframe&gt;
<i> </i> &lt;form name="root" action=""&gt;
<i> </i> &lt;input type="button" onclick="FrameRedirect('http://www.google.com')" value="google"&gt;
<i> </i> &lt;input type="button" onclick="FrameRedirect('http://www.yahoo.com')" value="yahoo"&gt;
<i> </i> &lt;input type="button" onclick="FrameRedirect('about:blank')" value="etc.."&gt;
<i> </i> &lt;input type="text" name="location" value="about:blank"&gt;
<i> </i> &lt;input type="button" onclick="FrameRedirect()" value="goo"&gt;
<i> </i> &lt;/form&gt;
<i> </i>&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@popomanauthorJan 07.2007 — Thank you very much. It works perfectly.
×

Success!

Help @popoman spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...