Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript troubleshoot--SimpleswapSetup is not defined???

    Hi,

    I'm working on a website and I keep getting this error "SimpleswapSetup is not defined". I'm not really fluent in JS, so I haven't a clue what's going on.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    
    <head>
    
    	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    	<meta http-equiv="Content-Language" content="en, it, es, fr" />
    
    	<title>Oceano &raquo; GrobanWire.com</title><!--???-->
    
    	<meta name="keywords" content="" />
    
    	<meta name="description" content= "" />
    	<meta name="author" content= "Pristine Ong @ GrobanWire.com" />
    
    	<link rel="stylesheet" type="text/css" href="/layout4/css/main.css" media="screen" />
    	<link rel="stylesheet" type="text/css" href="/layout4/css/sifr_print.css" media="print" />
    	<link rel="icon" type="image/ico" href="/layout4/images/layout/favicon.ico" />
    
    	<!-- compliance patch for microsoft browsers -->
    	<!--[if lt IE 7]>
    		<script src="ie7/ie7-standard-p.js" type="text/javascript"></script>
    	<![endif]-->
    	<!--this must be BEFORE simpleswap.js-->
    
    	<script type="text/javascript" src="/layout4/js/sifr.js"></script><!--sIFR 2.0.2; Latin I embedded in swf-->
    	<script type="text/javascript" src="/layout4/js/simpleswap.js"></script><!-- an alternative? -->
    
    </head>
    
    <body onload="SimpleswapSetup()"><!--invalid???-->

    The error occurs at just about this point. The function refers to an included JS file called simpleswap.js that is stored in js/simpleswap.js. Now, when the file containing above code is in the same directory as the folder js, the error doesn't occur; the error occurs when the file isn't in the same directory. What am I missing?

    Thanks in advance!

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,032
    Thanks
    0
    Thanked 248 Times in 245 Posts
    Is the path to the js correct? Put an alert inside the simpleswap.js file to verify that the file is loaded properly. You may need to delete the browser cache to ensure the latest file is loaded.


  •  

    Posting Permissions

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