I want to make an if stament that will do a thing if the browser is Internet Explorer. Else if the browser is Netscape will execute other code. How can I make that?
if (Internet Explorer)
{execute this code}
else if (netscape)
{execute this other code}
?
PS-also, is there a tutorial or reference that sais what commands are supported by each kind of browser?(most important for me at the moment is knowing wich commands are supported by browsers to show and hide layers..)
is it possible to track whether user is typing in the browser's address bar or aside google search box ( which appears in most of the browsers besides address bar)? if yes, I would like to know HOW? references are welcome.
I want to log out the user when close the browser, so i need to call the java script function when close the window. I used the onunload and onbeforeunload event but it should call on each page navigation and page refreshing. My necessity is, The function should call only at the time of browser closed..that should be mainly supported in all browsers...
I own a game site and some users cheat by changing the browser URL. For example :
The URL for starting a game mission is this : ww.somesite.com/somethingaspx?htxm=18
And if they change the number to 87 they go to the end of he mission WITHOUT actually completing it.
They ONLY way to deal with this is by preventing users from changing the URL manually. Is there a way to do it? Like, if someone tries to change that number in the URL he gets a message and browser window closed(or something that will prevent him from going to that page)
Of course, the solution must not conflict with the normal navigation(which is the actual mission) which means the user should be able to navigate to different pages but NOT change the URL manually.
Is there any way that an Apache server can recognise that a users browser has changed from your web site to another site. ie. is there a way of executing a CGI based on when the address bar no longer has your FDQN. Would this be via Javascript [if possible?] or ???
Does anyone know how to make it prompt the user if they try to close the browser window? Basically if someone goes to file->exit, or tries to navigate to another site, I want a confirmation box to pop up and say are you sure?
Please note I am not using this to annoy regular visitors - this is only going to be a part of my admin panel where I frequently forget to complete the last step, I just want to add a friendly reminder for myself.
I am having troubles with a script that returns the user's browser version... it keeps showing as IE 7 yet I have IE 8. If I duplicate the files and run it from a different folder, the code works correctly. If you can point me in the direction of where to look and what to look for
I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a signal to server.
This seems to be achievable with body unload events, but it is little too much, as even if user navigate within my site, this event will be generated, this can be avoided by handling onclick of each link, so that I'll know exactly which link is clicked, but honestly this looks over doing to me, any other smart short cut for finding out when user click on X in browser?
I'm using a little javascript to help my site's design to fit the visitor's entire browser window. Everything works great apart from one problem. If a visitor first loads the page and the browser isn't maximised, the page loads correctly BUT if the visitor then proceeds to maximize the browser, the page is still set for the minimised browser. This condition stays until the visitor goes to another section of the site or refreshes the page. When this happens, the page again loads correctly.
I would like to force a page reload whenever the browser is minimizedmaximized or is in any other way changed size. How can I do this?
I need to call a javascript function when the user closes the browser window. I have tried onunload but that runs when the user clicks a new link as well. I need something that only runs when the browser window is closed.
I would like to know what is the the easiest way to get if the user is browsing internet in fullscreen?I use following code:
var windowHeight = $(window).height(); // returns height of browser viewport var documentHeight = $(document).height(); // returns height of HTML document var windowWidth = $(window).width(); // returns width of browser viewport
Does anyone know of a list of browser user agent strings, produced by the navigator object? - navigator.userAgent
Like every other web developer, I'm writing some browser-specific code, but don't have the means to test it on every browser out there. However, if I had access to the user agent strings produced by each browser (or at least the *main* browsers) I could figure it out without the need for actual testing.
I'm developing a site that will use technologies like JavaScript and AJAX. I want the site to be functional for people that has older browsers or JavaScript turned off so for this I need to find out if the user's browser is supporting JavaScript and AJAX.
How can I check this in an easy and simple way? I.e the user enters my website with JavaScript turned off at the moment. And then he turns it on and reloads the page. I would like to catch that he has turned JavaScript on. The same goes with AJAX (although there is no off/on setting for AJAX).
I need to create an application that will open a popup when the user closes a window. I can do that easily via onUnload event of javascript but the catch is that the popup must open only when we close the window and not when we submit a form or click a link on the page.Actually it is a survey which opens only when one closes the window.
I'm looking for nice solution to handle file downloads. The problem with classic link in <a href="file"> is that in case of missing file, the main browser window is reloaded with 404 error, but I'd like to present to user a popup message without reload of main browser window.
I need to allow user to download mp3 files when they click on the link rather than streaming the audio in the browser. Need to use only Javascript to download the file.
i am developing a web application in which i have to retrieve the user browser and platform information. i am using javascript to get this information and tryin to pass these values to the html hidden form element. pasting a brief code from my application.
I have a website that I am maintaining that was built some time ago. There is a little speaker icon on a page that allows a user to click to hear the pronunciation of a word.
I have a site which requires the user to upload multiple images at once. Using jQuery I have set it up so that the user can select individuals individually (using the file browser) and then upload them all at the same time bty clicking 'Upload'. However, this is not really good enough...
What I need to happen is that when the user browses their machine to select their images, they are able to select multiple images through CTRL+click. At the minute they can only select one image at a time.
As I already have the upload process working perfectly, I would prefer that I was able to keep this intact and simply add some javascript which allowed multiple images to be selected by the file browser at the same time. I would also prefer, if possible, not to use flash.
I am generating a series of links with the name of my clinics. Each has its id (ie permission0, permissions1 . . .) and shows the name of the clinic. When the user clicks on the link I need to show the details of that clinic, but for the moment I don't know how to tell createDialog() which link was clicked. Code:
I want to do is determine whether the selected checkbox is on or off. At the moment, when the checkbox is ticked or unticked the javascript returns false.