Your Ad Here Your Ad Here
Results 1 to 7 of 7

Thread: need some help!!

  1. #1
    wishmaster2's Avatar NetEmpire BT Rep: +30BT Rep +30BT Rep +30BT Rep +30BT Rep +30BT Rep +30
    Join Date
    May 2006
    Posts
    714
    hello...i have un html project for the uni and its almost finished now...but i have to add a javascript and a php on that to complete it... without dreamweaver..i have to write the code on text document...anw my question is...how do i add javascript on a complete html site? i will Appreciate any help i can get!!! thanks!!

  2. Internet, Programming and Graphics   -   #2
    wishmaster2's Avatar NetEmpire BT Rep: +30BT Rep +30BT Rep +30BT Rep +30BT Rep +30BT Rep +30
    Join Date
    May 2006
    Posts
    714
    anyone!!??!!??!!

  3. Internet, Programming and Graphics   -   #3
    tesco's Avatar woowoo
    Join Date
    Aug 2003
    Location
    Canadia
    Posts
    24,069
    Anywhere in the code, best in the <head> area, just put something like:
    HTML Code:
    <script type="text/javascript">
    <!--
    //blah blah blah code here
    -->
    </script>

    What do you need this javascript to do?

  4. Internet, Programming and Graphics   -   #4
    wishmaster2's Avatar NetEmpire BT Rep: +30BT Rep +30BT Rep +30BT Rep +30BT Rep +30BT Rep +30
    Join Date
    May 2006
    Posts
    714
    i need it to pop-up a new window...

  5. Internet, Programming and Graphics   -   #5
    tesco's Avatar woowoo
    Join Date
    Aug 2003
    Location
    Canadia
    Posts
    24,069
    HTML Code:
    <html>
    <head>
    <title>Example</title>
    <script type="text/javascript">
    function popup_window()
    {
    window.open('http://filesharingtalk.com/vb3/','Window Title','width=800,height=600');
    }
    </script>
    </head>
    <body>
    <a href="#" onclick="popup_window();">Open Popup Window</a>
    </body>
    </html>
    Read here: http://www.pageresource.com/jscript/jwinopen.htm
    There are more attributes you might need to add to allow the new window to scroll, have toolbars, menubar, address bar, etc.
    Last edited by tesco; 05-06-2007 at 05:03 PM. Reason: Automerged Doublepost

  6. Internet, Programming and Graphics   -   #6
    wishmaster2's Avatar NetEmpire BT Rep: +30BT Rep +30BT Rep +30BT Rep +30BT Rep +30BT Rep +30
    Join Date
    May 2006
    Posts
    714
    thanks dude!!! done that!!!

  7. Internet, Programming and Graphics   -   #7
    Snee's Avatar Error xɐʇuʎs BT Rep: +1
    Join Date
    Sep 2003
    Location
    on something.
    Age
    38
    Posts
    22,677
    function loginWindow()
    {
    //Works in FF and IE, but not in IE-tabs through FF.
    if(!logged)
    {
    //Creates a login window if the user isn't logged in.
    //The new window calls the validator() function as th ok-button is clicked.
    newWindow = window.open("", "newWindow", "height=100, width=220, toolbar=no, menubar=no");
    newWindow.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2//EN'>");
    newWindow.document.write("<html><head><title>Login</title><link rel='stylesheet' type='text/css' href='main.css' /></head><body>" +
    "Username: <input class='outerInput' id='un' type='text' /><br />Password: <input class='outerInput' id='pw' type='password' />"
    + "<input class='activeField' type=submit value='OK' onclick='opener.validator();'></body></html>");
    newWindow.document.close();
    }
    else
    {
    //Calls click() to set the internal page to the content div if the user i s logged in.
    click("pages/internal.html", "", "html", "internal")
    }
    }
    A function I wrote in an old project.

    It generates a simple ~popup, if the user isn't logged in.

    The function resided in an external .js, which I accessed with <script type="text/javascript" language="javascript" src="main.js"></script> between the <head>-tags.
    Last edited by Snee; 05-09-2007 at 04:06 PM.

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
  •