Results 1 to 5 of 5

Thread: I need help

  1. #1
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I need help

    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>

  2. #2
    Join Date
    Feb 2007
    Location
    England
    Posts
    254
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default hi

    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

    Code:
    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));

  3. #3
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default No luck

    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?

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    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.
    - Mike

  5. #5
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Or are annoyed at ads.
    Only activex is a security risk.
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •