|
| |||||||||
| Tags: ajax, ip address, javascript, timestamp, verification |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| 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
| |||
| |||
| Re: Verify if there is javascript Quote:
|
|
#3
| |||
| |||
| 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
| |||
| |||
| 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. Quote:
(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
| |||
| |||
| 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
| |||
| |||
| 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? |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Verify if there is javascript" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to verify who called me? | tower33 | Off Topic Chat | 1 | 01-07-2010 06:47 PM |
| How to Verify Windows 7 ISO | FlashX | Tips & Tweaks | 2 | 02-04-2010 01:07 PM |
| NTBackup verify failed | nbocevski | Small Business Server | 1 | 25-06-2008 05:16 PM |
| Verify email address | CRK | Windows XP Support | 2 | 07-04-2007 09:09 AM |
| Can't Verify My Email | Walter | Windows XP Support | 3 | 27-01-2007 11:48 AM |