More specifically, when a user comes from craigslist.org/anything/ , I need to be able to make a substitution of a couple of html elements during their session. Very likely I will be making that substitution through some combination of js and php - right? - but I'm not quite confident in how I should start off. The site in question is c.spinnakerapartments.com - I need to change the phone numbers on a particular category of posts, such as http://www.spinnakerapartments.com/p...innaker-brook/.
If anyone just has any theories about how this should work, then PLEASE share them! And if you have a code snippet that might start work in this direction, that I can modify and play with, then PLEASE share that as well, it would be very helpful.
One - gets info to change on the page, selected by getElementById "phoner." Currently this snippet offers a direct input button to initiate the change of innerHTML -- so, I need that change to instead happen due to the referrer variable ...
var userInput = document.getElementById('userInput').value;
document.getElementById('boldStuff2').innerHTML = userInput;
<p>Welcome to the site <b id='boldStuff2'>dude</b> </p>
<input type='text' id='userInput' value='Enter Text Here' />
<input type='button' onclick='changeText2()' value='Change Text'/>
<!-- Hide script from old browsers
if (document.referrer != 'craigslist.org')
document.write('Thanks for visiting from ' + document.referrer);
//-- Stop hiding script -->
Okay, I am getting this whittled down a little. The following code is sucessfully checking the referrer, of that I am sure - but I have something wrong in my syntax to do the innerHTML switch only when the correct referrer is matched. If anyone has any ideas, please let me know, hopefully I'm getting this code to a place where it makes a little more sense. Thanks!
var hello = 'Hello World';
if (document.referrer = 'http://plrdaily.net')
document.getElementById('phoner').innerHTML = hello;