SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    authorise sites to scripts

    Code:
    var allowedSites="mysite.com,hissite.net,hersite,oursite.co.uk,theirsite".split(",");
    var j=allowedSites.length; var siteAuthorised;
    for(i=0; i<j;i++) { if((siteAuthorised=this.location.href.indexOf(allowedSites[i])>0)==true) i=j; }
    alert(siteAuthorised)
    I'm trying to set up a script that will allow some sites to use my scripts directly.
    I tried the above but having problems in IE.
    Can someone suggest where I may be going wrong, or how to better the script.
    I know its basic, but it'll help......
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  2. #2
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Not to worry, it was the alert that was causing the problem................
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


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
  •