Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Dec 2007
    Location
    Lancashire
    Posts
    36
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Unhappy Tell a friend script: point to different location?


    I'm putting a tell your friend script on my website. I want it to point at my domain name (www.aspecialdate.co.uk) It keeps coming back with my homepage
    html title: homepage.ntlworld.com/index.html. I can't find it in my webpages html
    to change it. Is it something to do with this line in the script: (var initialmsg="Hi:\nYou may find this site cool to visit! "+window.location) the"+window.location bit? Please could you help I'm struggling a bit. Thanks Frank

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,984
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    window.location means the current page.

    You want something like:-

    var yourDomain = "http://www.aspecialdate.co.uk/index.html";
    var initialmsg="Hi:\nYou may find this site cool to visit! "+ yourDomain;
    alert (initialmsg);


    It is your responsibility to die() if necessary….. - PHP Manual
    Last edited by Philip M; 12-28-2007 at 07:44 AM.

  • Users who have thanked Philip M for this post:

    fnewsome (12-28-2007)

  • #3
    New Coder
    Join Date
    Dec 2007
    Location
    Lancashire
    Posts
    36
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Smile

    Thanks I'll try it, See you a bit later Regards Frank

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,984
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    It looks like you are using the script from JavaScriptKit.

    If so it should work fine with the modifications I suggested.

    But you should delete the lines:-

    //u = window.location;

    and

    //window.location = "mailto:"+document.eMailer.email.value+"?subject="+initialsubj+"&body="+document.title+" "+u;

    I take it you will get rid of "Hi buddy" and other buttock-clenching Americanisms!

  • Users who have thanked Philip M for this post:

    fnewsome (12-28-2007)

  • #5
    New Coder
    Join Date
    Dec 2007
    Location
    Lancashire
    Posts
    36
    Thanks
    13
    Thanked 0 Times in 0 Posts
    The tell a friend button works just fine. But now it throws a box up when I open the page. With the email message inside. Is it something to do with alert?

  • #6
    New Coder
    Join Date
    Dec 2007
    Location
    Lancashire
    Posts
    36
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Thumbs up Done it!!!!!!!!!!!!


    Hi, Thanks.
    Got shut of the alert box! and it works perfectly

    Can't thank you enough been working on this all bloody night.

    And yes I've changed the wording into English slang!!

  • #7
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,984
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    I hope you will not be offended, but you have a nice professional looking website and it would be a pity to spoil it with this sort of thing.

    This "Tell a friend" type of script dates from the earliest days of the internet, and is rarely found now except on obviously amateur sites. Some people - myself included - do not wish to send out what amounts to spam, or do your "viral marketing" for you. Naturally it is entirely up to you, but personally I would re-think the idea.


  •  

    Posting Permissions

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