Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , ,

Sponsored Links



Verify if there is javascript

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 28-01-2010
Member
 
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.
Reply With Quote
  #2  
Old 29-01-2010
Member
 
Join Date: Nov 2008
Posts: 1,187
Re: Verify if there is javascript

Quote:
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.
Reply With Quote
  #3  
Old 29-01-2010
Member
 
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?
Reply With Quote
  #4  
Old 29-01-2010
Member
 
Join Date: Nov 2008
Posts: 1,032
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:
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 ...
Reply With Quote
  #5  
Old 29-01-2010
Member
 
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 .
Reply With Quote
  #6  
Old 29-01-2010
Member
 
Join Date: Nov 2008
Posts: 1,032
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?
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 04:17 AM.