I'm working with a client who's stuck using a widget based website and needs a custom built web app. We're hosting it off site. I need to pull product information from their main site to populate the off site page.
I wrote this to pull H1 content from their main site, this will serve as the link to the off site page.
<a href="#" id="specialURL">BUILD LEASE</a>
var url = $('h1').html();
url = url.replace(/\s+/g, '-').toLowerCase()+'.html';
$('#specialURL').attr('href', 'http://joethemovie.com/' + url );
Anything you're sticking in a url should be uri encoded. this will take care of spaces too so the regex isn't necessary..
$('#specialURL').attr('href', 'http://joethemovie.com/?h1=' + encodeURIComponent(url) +"&price=" + encodeURIComponent("about tree fiddy"));
Then you can get that junk from the url using the server (php's