Results 1 to 4 of 4

Thread: load an html file in javascript

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2004
    Location
    in the heart of the Mediterranean
    Posts
    1,143

    load an html file in javascript

    Hey,

    I have this piece of code with does not function correctly. I have little experience with Javascript. Can someone help pls?

    <head>
    <title>Membership</title>
    <script language="javascript" type="text/javascript">

    Code:
    function Validate() {
    Message = "";
    Message = Message + CheckName();
    Message = Message + CheckPassword();
    Message = Message + CheckConfirm();
    Message = Message + Compare();
    
    if (Message == "") {
    	alert ("well done");
    	window.open( "file:///C:/Users/Main/Desktop/menu/Thankyou.htm","__self");
    	return true
    }
    else {
    	alert(Message);
    	return false;
    }
    
    }
    however if I change this line to this it will be okay:

    window.open( "file:///E:/Myfolder/Int-IT/Int-IT/Wed&#37;20Design/menus/Thankyou.htm","__self");
    ------------------------------------------------------------------------
    If an answer to your question has been helpful, then please, Rate it!

  2. #2
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: load an html file in javascript

    Where is your file (the one you're showing code from) located? On C:/? On E:/? Elsewhere?

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: load an html file in javascript

    My guess would be that file:///C:/Users/Main/Desktop/menu/Thankyou.htm as defined, doesn't exist.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2004
    Location
    in the heart of the Mediterranean
    Posts
    1,143

    Re: load an html file in javascript

    That code fixed. Thankyou
    ------------------------------------------------------------------------
    If an answer to your question has been helpful, then please, Rate it!

Posting Permissions

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



Click Here to Expand Forum to Full Width