Results 1 to 6 of 6

Thread: Verify if there is javascript

  1. #1
    Join Date
    Jan 2010
    Posts
    48

    Verify if there is javascript

    I try to do something that seems simple to me but I found a problem:

    After inserting my JavaScript file, I have an Ajax request to insert the IP and the timestamp at the time the code is read. I added with a sleep (2) and I do a query on my table to check if this is ip with a timestamp> = 2 in my table which shows me that the Ajax request is past and that JavaScript is enabled.

    However, the sleep stops the script, then insert my looks and fits before the select is not the pa line must be present to refresh my select find good but not at the time I desire. I do not want to reload

    Is there anyone of you who have an idea, the goal is then to have a session variable that tells me if JS is enabled.

    Please help if someone see a solution other than the noscript tag rather in the spirit of what I would do.

  2. #2
    Join Date
    Nov 2008
    Posts
    1,185

    Re: Verify if there is javascript

    I do not want to reload
    But, by definition, if JS is disabled, it will be hard to make Ajax. And your application is not clear. Could you show us the code for your Ajax call if you want us to better understand your context.

  3. #3
    Join Date
    Jan 2010
    Posts
    48

    Re: Verify if there is javascript

    Thank you for your attention, I have the code under the eyes but I'll explain the "algorithm":

    I come on my page: my insert.js (jquery, etc.)

    Next: Ajax request which is an insert in the base of the visitor's id and the timestamp

    Then sleep (which does not work because the script block so I need an alternative, I tried synchronous Ajax request, but gave her nothing, the purpose of sleep or other attended and that the Ajax request is made)

    Then: After the sleep (the application is supposed to be spent), I look if I have a php line with this ip and a recent timestamp (time of sleep). If the line exists, is that the Ajax that I spent so JavaScript, otherwise the mean is not JavaScript enabled (or the query went wrong but it is less likely)

    Then I can save the result as a function of select my session variable ['JSactive'] (0 or 1)

    Did you understand better?

  4. #4
    Join Date
    Nov 2008
    Posts
    1,022

    Re: Verify if there is javascript

    It illuminates not so: you do not speak JavaScript as treatment. Nothing to do or when, if JavaScript is disabled.
    the goal is then to have a session variable that tells me if JS is enabled.
    The problem is that to do so automatically, it should be used ... JavaScript
    (to do it via Ajax or submit a form automatically).

    What you can do is set your session variable to FALSE, then the loading of the page to call Ajax pass TRUE.

    So eventually, you'll have the info you want in your session variable ...

  5. #5
    Join Date
    Jan 2010
    Posts
    48

    Re: Verify if there is javascript

    That's what I want to save my session variable and add it after my script in php page that Ajax appeal of the asynchronous side of things. So I get it back than reloading the page not following the script of php my main page. Its not very serious .

  6. #6
    Join Date
    Nov 2008
    Posts
    1,022

    Re: Verify if there is javascript

    But if you do not have JavaScript enabled, you do NOT use Ajax! In this case you can never retrieve the client side without changing the page (or life then an iframe )

    In that (try to) understand: What can you do if JavaScript is disabled?

Similar Threads

  1. How to verify who called me?
    By tower33 in forum Off Topic Chat
    Replies: 1
    Last Post: 01-07-2010, 05:47 PM
  2. How to Verify Windows 7 ISO
    By FlashX in forum Tips & Tweaks
    Replies: 2
    Last Post: 02-04-2010, 12:07 PM
  3. Regex to verify data
    By Gunner 1 in forum Software Development
    Replies: 5
    Last Post: 16-02-2010, 05:27 AM
  4. Verify Subscription to Mcafee
    By SunnyDay in forum Networking & Security
    Replies: 3
    Last Post: 17-08-2009, 09:54 AM
  5. Can't Verify My Email
    By Ashish Goenkar in forum Windows XP Support
    Replies: 2
    Last Post: 27-01-2007, 11:48 AM

Tags for this Thread

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
  •  
Page generated in 1,750,285,299.09066 seconds with 16 queries