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..)
For some god-forsaken reason (which I can't find out either) MSIE stopped executing any JavaScripts. In any page which contains JavaScript code, that code won't be executed. There are no error messages, no warnings, nothing. It simply does'nt work. I'm pretty sure this could be caused by some stupid installation of another program that messed up some IE settings.
Security settings for IE are all lowered down. Everything is activated (Scripts, ActiveX, automatic download of anything, anytime)... so we ran out of ideas of what could be the problem. And yes, we have also tried to reinstall IE.
The only clue we have is that a local Administrator user can change IT security settings for himself and (go figure) things work fine! The problem occurs with users that have limted access to the computer and I am pretty sure this shouldn't happen. If you are wondering... yes... the local administrator has already tried to change the settings for limited user account..
The foklowing code works fine in Firefox, but not in MSIE;var title = $("title").text();I want to know the <title>blabla</title> as you can see. But MSIE does not support this.
Here's what used up the last couple of hours of my time.
The Mac version of MSIE will not load a script that has this in it:
theItem.elm.value = theItem.elm.value.replace(/^s*(.*?)s*$/, "$1"); Now I had other regular expressions in the script done this way, but in this one case I had to use the object constructor method.
It will won't work in this browser, but now at least the script loads and other functions in the same file work.
I have a solution so basically I'm looking for some insight into this if anyone has it. What is it about this particular expression that upsets Mac MSIE?
I have a problem with internet explorer to show images. Please take a look at: [URL] and click into any image. Using FF, chrome and safari clicking an image show a big centered image with position fixed. Using internet explorer is a full wrong.
The frame name is "there", also, there are attributes that are taken out of an anchor on the page (valueC and valueD). it seems to fall apart because Netscape doesn't evaluate the "this.page.locC", which is in the "there" iframe How do I pull attributes from out of a frame?
In the attached code, I get no errors running in either the MSIE or FF browsers. BUT, the actions are different. I'm trying to figure out why.
[Code]...
It works as designed and intended in FF browser:
1. Each section opens when clicked on, and 2. Other sections close when a section is chosen, and 3. Same section closes when clicked in succession. (same for both)
In the MSIE browser, it works as this:
1. Each section opens when clicked on, but 2. Other sections open also when chosen and first selection stays open and 3. Same section closes when clicked in succession. (same for both)
Any reason for this in MSIE and FF browsers for #1 and #2 above? how to make both scripts work the same in both browsers?
And I have developed an Ajax based search module that primarily does the following:
Lets the user select a Country and then loads via AJAX a drop down full of areas and then when an area is selected loads another drop down menu full of towns.
The Ajax functions fine and it all looks great in Firefox. But there is a problem with the background in internet explorer.
When the new <select> is loaded the background stays white in a small strip. Does anyone have any experience with this bug?
MSIE 6.0 apparently does not support protyping with objects created with document.createElement, while Firefox does.
I tested it by typing it into the adress bar, but it also appears to be the case for code embedded in a HTML document. Here's a simple segment of code to demonstrate the difference:
javascript: function myObj(){};myObj.prototype = document.createElement('a'); var x = document.createElement('a'); var y=new myObj(); var z= new Object(); alert(x.href) /*blank in both FF & MSIE6 */; alert(y.href) /* blank in FF but 'undefined' in MSIE6 */; alert(z.href) /* 'undefined' in both FF & MSIE6 */;
I wonder why that is (apart from the fact that MSIE implements JScript and not javascript), and can anyone tell me which of both browsers is complient with W3C standards?
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.
Any one have a way to determine the left pixel position of an element on a page (such as <input ...>, given a fixed value was not supplied originally. This needs to be done dynamically so several elements can be aligned by setting their css left values. Jquery is available if that is of any use.
I've been running around the web, including a search here, but haven't hit upon a solution that works. I'm trying to determine the document height of a web page. The following code produces a 0 (zero) onload, and again when the button is pressed. Right now, I'm working with Firefox 2 on Ubuntu Edgy. I'll worry about IE compatability later. Code:
Is there anyway using Javascript, one can determine whether or not the browser viewing the page supports a particular CSS property or value? For example, I know IE6 doesn't support the value of "fixed" for the "position" property, so is there anyway I can determine this with Javascript, without resorting to browser sniffing?
While attempting to create a greasemonkey script in FF2 (don't ask), I discovered that the "let" statement was causing my code to fail. After confirming that this statement has been available since FF2 (js engine 1.7) [URL] became curious as one determines their javascript engine in FF. IE has a way to inspect the jscript engine, ala [URL] but I couldn't find anything similar for FF. Feel free to list links for testing engines in other browsers,