I have this code on my page: This is directly on my page, I want to have it called from an external javascript file, can someone tell me how would I do this? (bear in mind that I almost have no knowledge of web coding) Thanks
What I mean is instead of having this code on my page, I want it to call another javascript file on a different folder, for example, gateway.js Something like <script language="Javascript" type="text/javascript" src="gateway.js"> </script> But I can't make it work
The way you use it, gateway.js is supposed to be in the same directory as the file that inclides this statement. If you want any page load it use this: <script type="text/javascript" src="/gateway.js"></script> J.D.
Yeas, that's what I am trying to do, but it won't work. What do I need to put in the gateway.js file? I tried using http://www.somesite.com/gateway.aspx?productid=4xxx&val=2xxx19 and src="http://www.somesite.com/gateway.aspx?productid=4xxx&val=2xxx19" but it won't work.
That shouldn't be a problem, I used the complete address to call the script (<script language="Javascript" src="http://www.mysite.com/gateway.js"> </script>) What would be the correct thing to put inside the .js file, JD?
I am back to where I started now. OK, this is my original code I want to get rid of that code that is currently on my page and have it on an external javascript file called gateway.js So... Would this be correct to have on my page? And, if that is correct, what exactly would I need to put inside the gateway.js file? The reason I need to have this .js file on a separate folder is that It is messing completely my site, it is a gateway that is also blocking the spider from indexing my pages, so I want to put it in a folder, disallow the spiders from visiting that folder, and forget about the stupid script and get my pages back, I have lost over 3,000 pages thanks to this.
Save the JS code returned by your original URL (the one with .aspx) as gateway.js - this is your content. Put this file into any directory on your website or any other website - it doesn't matter where you store it. Add either of these statements to your page (pick the right one depending on where the script is located): <script type="text/javascript" src="/gateway.js"></script> <script type="text/javascript" src="/dir/dir/gateway.js"></script> <script type="text/javascript" src="http: //www. site.com/dir/dir/gateway.js"></script> J.D.
I have no problems with the second part, it is the first one where I'm stuck. What exacly goes in the gateway.js file, is it or just I have no idea what you mean with "JS code returned by your original URL "
http://www.somesite.com/gateway.aspx?productid=4xxx&val=2xxx19 should return you JavaScript code. In fact, if you type it in the browser, you will see this code. Save this page as gateway.js. If you want, PM me the actual URL.
I think I now understand what I need to do, but I wonder if this will affect the tracking. I sent you a PM, let me know what you think Thanks!