PDA

View Full Version : I need help



rbennitt
04-12-2007, 04:18 AM
I am trying to load website into an iframe and cannot get it to work. I eventually want them to work on vairous resulutions. This is the code I have so far. It does not work wel at all. Please help, I am really counting on getting this to work! Thank you in advance

<html>

<head>
<title>Website Resolution Tester</title>
</head>

<body bgcolor="#FFFFFF">

<p>&nbsp;</p>

<FORM METHOD="LINK" ACTION="tester2.html">
Type the address of the site to test: <INPUT TYPE="text" NAME="webadd">
<INPUT TYPE="submit" VALUE="Click to Test">
</FORM>

<FORM NAME="roy">
<INPUT TYPE="hidden" NAME="bennitt">
</FORM>

<SCRIPT LANGUAGE="javascript">

var locate = window.location
document.roy.bennitt.value = locate
var text = document.roy.bennitt.value

function delineate2(str)
{
point = str.lastIndexOf("=");
return(str.substring(point+1,str.length));
}
document.write("Site Being Tested Is " +delineate2(text));

</SCRIPT>

<p>640x480</p>

<table border="0">
<tr>
<td valign="top" colspan="2" width="640"
bgcolor="#008000"><font color="#FFFFFF"><iframe name="home" src=document.write("http://" +delineate2(text)); width="100%" height="480" FRAMEBORDER="NO"></iframe></font></td>
</tr>

</table>


</body>
</html>

Bob90
04-12-2007, 06:00 PM
I don't know why you're passing the value to a text box, but I'm going to guess it is to turn it into a string.

Try



var text = window.location.toString();

function delineate2(str)
{
var point = str.lastIndexOf("=");
return(str.substring(point+1,str.length));
}
document.write("Site Being Tested Is " +delineate2(text));

:)

rbennitt
04-12-2007, 07:58 PM
Once i input the url i wanted to open in the window, the window disappeared, it did not give me a 404 error. thanks for the help, any more suggestions?

mburt
04-12-2007, 08:39 PM
Testing for screen resolutions is a bad idea. It will produce unreliable results, using an iframe and JavaScript.

You should tell your user that he/she needs a 1024/728 or whatever screen resolution for the page to appear correctly.

Better yet, use percentages to align your page correctly, then nothing can go wrong. Loading iframes with JavaScript is a really bad idea, considering some people have JavaScript disabled, because they may think that it is a security error.

boxxertrumps
04-12-2007, 10:06 PM
Or are annoyed at ads.
Only activex is a security risk.