• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Another jscripty question

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Another jscripty question

    Think this is probably another daft question re an impossible but again someone may know different.

    My ed. s/w interactives have a random function that swaps various elements and pictures when a refresh button is clicked. On some I would prefer specific pictures when first opened so need to distinguish open from refresh but both clear any previous var values. Any way of doing it without reading or setting values in a file outside the document?

    This is not online but running in webbrowser in VB.NET so IE only solutions would be ok.

    Ta for any ideas.
    bloggoth

    If everything isn't black and white, I say, 'Why the hell not?'
    John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

    #2
    To be clearer here is picture. The tiles are dragged to others and if they match they disappear to uncover a background picture. On refresh the tiles appear in different places and there is a different background but I would like to use the most attractive background for the majority who only play the game once.

    Picture
    bloggoth

    If everything isn't black and white, I say, 'Why the hell not?'
    John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

    Comment


      #3
      I don't quite understand what you need but can you use cookies perhaps?

      Comment


        #4
        It's not completely clear to me either, if the refresh is reloading the page, can you just check for the http referrer (document.referrer) and if it's identical to the document.location run the code as it stands if not put the correct background image in place?

        Comment


          #5
          Originally posted by Jaws View Post
          It's not completely clear to me either, if the refresh is reloading the page, can you just check for the http referrer (document.referrer) and if it's identical to the document.location run the code as it stands if not put the correct background image in place?
          In principle that approach would work, but unfortunately the HTTP REFERER (misspelling by Tim Berners Lee when he invented the WWW ) header is automatically blocked by Norton Internet Security.

          There's no good reason for them to do this, but they do, and it means that the REFERER header is now completely useless, given the market penetration the NIS product has.

          I hate companies that break the web for the sake of making money out of peddling unjustified fear, uncertainty and doubt to the people we make the damn thing for in the first place - people who shouldn't have to know how it works

          Comment


            #6
            Don't have Norton but did do a check on document.referrer and it is permanently null so maybe others do it too. Ta for all the answers.
            bloggoth

            If everything isn't black and white, I say, 'Why the hell not?'
            John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

            Comment


              #7
              Originally posted by NickFitz View Post
              In principle that approach would work, but unfortunately the HTTP REFERER (misspelling by Tim Berners Lee when he invented the WWW ) header is automatically blocked by Norton Internet Security.

              There's no good reason for them to do this, but they do, and it means that the REFERER header is now completely useless, given the market penetration the NIS product has.

              I hate companies that break the web for the sake of making money out of peddling unjustified fear, uncertainty and doubt to the people we make the damn thing for in the first place - people who shouldn't have to know how it works



              Now that would be just too easy

              Comment


                #8
                Another solution may be to set your refresh code to do something like location=location + "?v=1" and then do a check for the querystring in the js. I think it may be available in document.location.search - alternatively just do a regex on the location string to checking for v=1 or whatever you set it to.

                Comment

                Working...
                X