SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Nov 2000
    Posts
    740
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Script to modify url

    When I am viewing Google.com in my browser, I want to queue up US based adwords. I live in the UK so geotargetting looks at my IP address and serves me UK adwords ads.

    To get around this, I want to create a simple script that ads &gl=us to the search url in Google. This has the effect of switching the adwords results to US ads.

    Someone gave me a couple of ideas but I don't really know javascript so wondered if someone could help?

    Code snippets:

    Code:
    javascript:location.href=location.href+'&gl=us' 
    and...
    if (location.host =='google.com' or location.host=='www.google.com'){location.href=location.href+'&gl=us'}
    Idea is I can click a button and it will convert the url by appending &gl=us

    Can anyone help?

    Thanks,

    Jon

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Javascript is imbeded in a web page. When a web page is loaded in the browser, the javascript that is embeded in the web page executes. Unless you get a job at Google and sneak into coporate headquarters at night, and then insert your javascript on Google's home page, your javascript won't execute when you load Google's home page in your browser.

    Idea is I can click a button and it will convert the url by appending &gl=us
    You also can't add buttons to someone else's website.


Bookmarks

Posting Permissions

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