View Full Version : getting source from another site
ja2bo2t
06-19-2005, 11:16 AM
Hey guys, i'm currently in the development of a new website with an affiliate program. They don't give the tools that i want so i decided that i would try to program my own.
They do have a way to search their site, through my site, using a <script language="javascript" src="link from the affiliate site">
My site is about cars, and car parts, so i have 4 pull down list menus to select their make, model, year, and what they want to buy. I then create a link using these things using a string array and just combining them together. The problem that i am having is that i dont know how to modify the <script language="javascript" src="THE LINK I HAVE">. It seems like you cant made this a variable, only a specific link. Is there any way to do this or am i just wasting my time?
Hi,
Is the javascript supplied by your affiliates? Also are you sure that editing the code doesn't break the terms of use?
If you like you can post the web site and we can have a look for you.
Cheers,
Paz.
ja2bo2t
06-19-2005, 12:34 PM
Alright i guess i can explain it further.
I am going through ebay to search for different parts, etc... They provide a way to put a search for a specific item on your site, but it must remain static. An example would be a search for a honda civic, they say to put a
<language="javascript" src="http:// REALY COMPLEX CODE +honda+civic+ MORE REALLY COMPLEX CODE">
and then it pops out on your screen nice and fancy in a table on my site, all the products for the search honda civic. I was hoping that the user would be able to edit the search, like find a sunbird or something, without having to exit my site and going to their site.
So i decided to let them choose what they wanted, through list menus (all the different makes, etc.) and used the original code (the complex stuff) and through the new information in it. The link that i create works great but i dont know how to change the src= without copying my link created and pasting it in the code, saving it, then loading it back up. I figured that there must be an easier way.
O an the editing violated terms of use... i dont know but if i make them money i dont see why they would care?
ja2bo2t
06-19-2005, 12:52 PM
O, i looked it up and changing it does not violate the terms of use.
Hi,
it is possible, if I understand you correctly, though javascript may not be the best soloution. I would need to look at the site though to be sure I understand what you mean. If you like you can PM me with it.
Cheers,
Paz.
BSolveIT
01-22-2007, 08:03 PM
Its hard to know exactly what your looking for without some additional context, but the code I wrote below should put you on the right track:
<head>
<title>Some Page</title>
<script type="text/javascript">
function swapper()
{
//set this to whatever you want the src url to be
var url = "http://www.xyz.com/someotherscript.js"
var headTag = document.getElementsByTagName("head").item(0);
var scriptTag = document.getElementById("myscript")
scriptTag.src = url;
headTag.appendChild( scriptTag );
}
</script>
<script id="myscript" type="text/javascript" src="http://www.xyz.com/somescript.js"></script>
</head>
Let me know how you get on, or if you need anymore help?
8-|
BSolveIT
01-25-2007, 02:36 PM
Ahhhh!! I've just realised that I've replied to an 18 month old thread.
D'oh!!
jocelyn
01-25-2007, 04:36 PM
[QUOTE=BSolveIT]Ahhhh!! I've just realised that I've replied to an 18 month old thread.
D'oh!![/QUOTE]Well, a spammer had awaken it, and I deleted his post... so you did not dig it out...
BSolveIT
01-25-2007, 08:30 PM
Ohhh! Well thats good then - means I'm not entirely losing my marbles yet. Well, not entirely anyway. hehe
;)
vBulletin v3.0.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.