My javascript code is working in IE and its not working in any other browser


Hi

  I write the below javascript code for populating some values and add it to the combo box this function is working in IE and its not working in an other brower. I run the web page in IE all the populating values added in the combo box and I run the page in mozilla no values add in the combo box.This is very urgent requirement for my project kindly tell any solution for the above issue. 

 

function
FeaturedSpaceContainerListController(containerSelectList, featuredSpaceSelectList, allPagesText, allFeaturedSpacesText, selectedFeaturedSpaceID, mode, onFeaturedSpaceChange)

{

// allPagesText is the text to be used for the 'all' option in the container list (the first item).

this.allPagesText = allPagesText;

this.allFeaturedSpacesText = allFeaturedSpacesText;

// onFeaturedSpaceChange is a callback method that, if supplied, will be called whenever *a feature space* is selected (*not* when 'all featured spaces' is selected).

if(onFeaturedSpaceChange) { this.onFeaturedSpaceChange = onFeaturedSpaceChange; }

 

this.UpdateContainerSelection = function()

{

var selContainers = this.listController.selContainers;var selFeaturedSpaces = this.listController.selFeaturedSpaces;

 

var selectedFeaturedSpaceID = selFeaturedSpaces.options[selFeaturedSpaces.selectedIndex].value;

var containerIDForSelectedFeaturedSpace;

 

if(selectedFeaturedSpaceID == 0)

{

return; //Looks like we're in search mode and the user has chosen "All featured spaces" - the container selection

// does not change in this case.

}

 

for(var i = 0; i < GetNumFeaturedSpaces(); i+=3)

{

if(arrFeaturedSpaces[i+1] == selectedFeaturedSpaceID)

{

containerIDForSelectedFeaturedSpace = arrFeaturedSpaces[i];

break;

}

}

 

for(var i = 0; i < selContainers.options.length; i++)

{

if(selContainers.options[i].value == containerIDForSelectedFeaturedSpace)

{

selContainers.selectedIndex = i;

this.listController.PopulateFeaturedSpacesList(selFeaturedSpaces, containerIDForSelectedFeaturedSpace);break;

}

}

}

this.PopulateFeaturedSpacesList = function()

{

var selContainers = this.listController.selContainers;var selFeaturedSpaces = this.listController.selFeaturedSpaces;

 

var selectedContainerID = selContainers.options[selContainers.selectedIndex].value;

 

var selectedFeaturedSpaceID = -1;

if(selFeaturedSpaces.selectedIndex >= 0 && selectedContainerID > 0)

{

selectedFeaturedSpaceID = selFeaturedSpaces.options[selFeaturedSpaces.selectedIndex].value;

}

 

while(selFeaturedSpaces.options.length > 0)

{

selFeaturedSpaces.options.remove(0);

}

if(selectedContainerID == 0 || this.listController.mode == "search")

{

var featuredSpaceOption = document.createElement("OPTION");

selFeaturedSpaces.options.add(featuredSpaceOption);

featuredSpaceOption.innerText =
this.listController.allFeaturedSpacesText;

featuredSpaceOption.value = 0;

featuredSpaceOption.selected =
true;

}

 

for(var i = 0; i < GetNumFeaturedSpaces(); i+=3)

{

var containerID = arrFeaturedSpaces[i];

var featuredSpaceID = arrFeaturedSpaces[i+1];

var featuredSpaceName = arrFeaturedSpaces[i+2];

 

if(selectedContainerID == 0 || selectedContainerID == containerID)

{

var featuredSpaceOption = document.createElement("OPTION");

selFeaturedSpaces.options.add(featuredSpaceOption);

featuredSpaceOption.innerText = featuredSpaceName;

featuredSpaceOption.value = featuredSpaceID;

if(featuredSpaceID == selectedFeaturedSpaceID)

{

featuredSpaceOption.selected =
true;

}

}

}

if(selFeaturedSpaces.selectedIndex >= 0 && selFeaturedSpaces.options[selFeaturedSpaces.selectedIndex].value > 0)

{

//A real featured space is now selected so call the featured space change callback.

this.listController.CallFeaturedSpaceSelectionChangeCallback();

}

}

this.SelectFeaturedSpace = function(featuredSpaceID)

{

var selFeaturedSpaces = this.listController.selFeaturedSpaces;

 

for(var i = 0; i < selFeaturedSpaces.options.length; i++)

{

if(selFeaturedSpaces.options[i].value == featuredSpaceID)

{

selFeaturedSpaces.selectedIndex = i;

if(featuredSpaceID > 0)

{

this.listController.HandleFeaturedSpaceSelectionChange();

}

break;

}

}

}

 

this.SelectContainer = function(selectedContainerID)

{

//Call this only when you want to force a container selection.

var selContainers = this.listController.selContainers;var selFeaturedSpaces = this.listController.selFeaturedSpaces;

 

for(var i = 0; i < selContainers.options.length; i++)

{

if(selContainers.options[i].value == selectedContainerID)

{

selContainers.selectedIndex = i;

this.listController.PopulateFeaturedSpacesList(selFeaturedSpaces, selectedContainerID);break;

}

}

}

 

this.PopulateContainersList = function(selectedContainerID)

{

var selContainers = this.listController.selContainers;

 

while(selContainers.options.length > 0)

{

selContainers.options.remove(0);

}

var containerOption = document.createElement("OPTION");

selContainers.options.add(containerOption);

containerOption.innerText =
this.listController.allPagesText;

containerOption.value = 0;

if(selectedContainerID == 0)

{

containerOption.selected =
true;

}

 

for(var i = 0; i < GetNumContainers(); i+=2)

{

var containerID = arrContainers[i];var containerName = arrContainers[i+1];

 

var containerOption = document.createElement("OPTION");

selContainers.options.add(containerOption);

containerOption.innerText = containerName;

containerOption.value = containerID;

if(containerID == selectedContainerID)

{

containerOption.selected =
true;

}

}

}

 


sweety.s
0
sweetymahesh
12/1/2008 6:01:51 AM
asp.net.client-side 24353 articles. 0 followers. Follow

4 Replies
255 Views

Similar Articles

[PageSpeed] 15

Go thru the following URL :

http://www.tek-tips.com/faqs.cfm?fid=5748


CSR
~ Please Mark as Answer if it solves your query ~
0
SATISD9X
12/1/2008 6:57:54 AM

It is very difficult to detect the problem from your code as it contains huge no of lines. As you know your project vry well, it might be easier for you to debug. Or you can tell us where (e,g. in which line ) do you have the problem?

Or, you can try to use FireBug addons for FireFox.

Thanks.


HOQUE MD.NAZMUL
[document.getReaders]
0
NHOQUE
12/1/2008 7:06:47 AM

To find out why it does not work in Firefox, invoke "Error Console" using the keyboard shortcut Ctrl+Shift+J or access that option from the Tools menu while you have opened your web page.

The Error Console will display Errors & Warnings related to CSS & Javascript that Firefox does not like possibly because the web page has some non-standard construct or erroneous code. Along with the helpful Error or Warning message, it also displays the file name as a hyperlink (to let you jump directly to the source) & line number in the source code that is causing it. There is a high probability that resolving these Errors & Warnings would make the page render fine.


M.V. 'Anil' Radhakrishna
Web Development Tips, Tricks & Trivia | My Code Gallery

Recent article - How To Create a Custom IE8 Accelerator

0
mvark
12/1/2008 11:29:37 AM

IE is the only one that uses innerText

var containerOption = document.createElement("OPTION");
selContainers.options.add(containerOption);
containerOption.innerText =
this.listController.allPagesText;
containerOption.value = 0;

it should read

var containerOption = document.createElement("option");
selContainers.options.add(containerOption);
containerOption.text =
this.listController.allPagesText;
containerOption.value = 0;

Another way to do it is in one line

var containerOption = new Option( this.listController.allPagesText, 0);

Eric


Pascarello.com | Twitter epascarello | LinkedIn
0
A1ien51
12/1/2008 12:30:28 PM
Reply:

Similar Artilces:

IntraWeb 14 and JavaScript : Some codes don't work on IW but work on IE.
I use IntraWeb 14.0.43 Ultimate on Delphi XE8 (Japanese Edition) on Windows 8.1 Pro (also Japanese Edition). My IW project is stand alone program and I wrote JavaScript code below to test XMLHttpRequest API of JS. My final purpose is to obtain JST (Japan Standard Time) from a server "http://ntp-a1.nict.go.jp/cgi-bin/jsont". However, the code below works well on MS IE 11 or Google Chrome but not works at all (on IE via IW) or unexpectedly works (on Chrome via IW). Why same code works differently dependent on via IW or not via IW ? the JS code: // --------------------------...

Cancelling client-side LinkButton OnClick event doesn't work in IE (but works in Firefox)
Hi, I have a number of LinkButtons in use on a site that might need to have their click events cancelled for some reason (client-side). I'm finding that the event isn't getting cancelled in IE7, but it does in Firefox.To see the problem in action:1) Visit http://www.yougodo.com/Home.aspx2) Type "ios" into the "Location:" search box3) CLICK the "Search for activities" button (do not press [enter] as this runs different client side code that works as it's not under the LinkButtons control)The client-side code should prevent the button from causing...

JavaScript Not Working In IE But Works In Netscape
Hello all, I am using the following javascript function: window.parent.location.href = MyNewPage.aspx If I display the page in Netscape or FireFox, the function works correctly.  If I display the page in IE, the function does not redirect the browser to the new page.  I know I am making the function call in IE because I have an alert statement before and after the "window.parent.location.href" function call.  In IE the first and second alert statement indicate the function is ignored.  In Netscape or FireFox, I do not execute the second alert, instead my browser is red...

Post Method not working for IE, but works for other browsers
I have been trying to solve this problem for a while now and have it narrowed down. I am on an XP SP2 trying to run ASP.NET. The page I can't seem to get to work is: <%@ Page Language="VB" Trace="true" ContentType="text/html" ResponseEncoding="iso-8859-1" %> <script runat="server" language="VB"> Sub Page_Load(Sender As Object, E As EventArgs) If Page.IsPostBack Then Select cmbPeople.value Case "Bill Gates" Response.Redirect("http://ww...

ScriptManager Work in Client side and not Work in server
 i have this line in my site            ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "script", "call3();", True)when i run my site in client (my computer) its workbut when i copy my site to server not work or function call3(); not callinghow can i solve my problem thanks for alltareq  Hi,tareqmr I am afraid we cannot find out the exact root cause without further information captured when the problem occurs. To troubleshoot this issue, we really need more source code to reproduce the problem...

Javascript Error in IE...Same script works fine in Netscape. What i need to change to make it work in IE?
function validCheck(frmObj){ var checkbox_choices = false; for (counter = 0; counter lifevision: function validCheck(frmObj){ var checkbox_choices = false; for (counter = 0; counter paste the complete functionMAKMark as Answer if this reply helps youMVP ASP/ASP.NetASP.Net Hosting : Host DepotMy Site : ASPSnippets place "var" before the variable counter: for (var counter = 0; counter < 10; counter ++){ }...

how to make javascript popup works even if javascript is disabled in client-side?
Hi  I noticed that in hotmail ajax version page. When I disable javascript in my browser and click "Delete" button without selecting any email messages, a alert popup still pops up ( I'm assuming it's javascript popup). Could anyone tell me how this could be done in asp.net?  Thanks in advance. You probably did not actually disable javascript or maybe you needed to restart your browser. I'm pretty sure I disable javascript in my browser because I have tested my site and hotmail page. My site can't show popup but hotmail page still have popup sho...

Some client side Javascript does not work.
Can someone please help me debug this piece of code? I've been at this for hours and all looks good but the Firefox complains. Also this won't work at all in IE or Safari. Can someone elaborate on the X-browser issue as well?Here are couple of caveats: The for loop is to simulate looping through a record set and as such I can have any number of records. I'm trying to achieve the following: When you click the C/B on the page following needs to happen. - Original C/B remains checked- The "Your Request List" will detach itself and float ( that part work but would like it t...

Client side code not working...
I am trying to do a couple things on the client - popup an alert and popup a new window to display results.  Neither of these work and I'm notgetting any error to indicate why they aren't working, the screen just flashes like it's reloading and nothing happens.  Here's my situation:I have a web form with two sections: at the top there is one text field and one button.  If the user enters text and clicks that button it should popup a new window with the "personDetails.aspx" page in it.  Below that section there is a much bigger area with several text fields, drop-downs, et...

Javascript works in IE, not in any other browser
The attributes and functions are all recognized in IE browsers, but not in any other browser (Firefox and Safari were tested).  It seems it doesn't even acknowledge the functions.  I declare the functions in the attributes of the controls during the Page_Load event as such:            Button1.Attributes.Add("onclick", "window.close();")                    TextBox2.Attributes.Add("onblur", "javascript:Add();")     &...

javascript (to control video) works in IE but not work in Firefox
Hi, I'm interested in synchronizing video with powerpoint slides. To control the video I use javascript but it does not work in FF. Here is the adress you can check. www.metu.edu.tr/~ari/smil When you click on an item below the video, the video should go to appropriate time. when you check it with IE it works fine but in FF it does not work. If anyone can help, I'll appreciate. Thanks _fatihari_ spoke thusly on 21/06/2006 8:57 AM: > I'm interested in synchronizing video with powerpoint slides. To > control the video I use javascript but it does not...

Javascript function is not working in IE and not working in Firefox 1.5
I dynamically create Options in a Combobox using javascript like: var cboBox=document.getElementById("cboTest"); var aoption=new Option("--Select--"," ",false,false); cboBox.add(aoption); It works fine with IE It does't work with Firefox 1.5 Could anyone help me! Thanks in advance Prakash S wrote: > I dynamically create Options in a Combobox using javascript > like: > > var cboBox=document.getElementById("cboTest"); > var aoption=new Option("--Select--"," ",false,false); > cboBox.add(...

Working
I have two servers running NW65sp4A (different trees). I initially installed BM3.8 patched to sp4 with VPN services ( Firewall services to follow after I know I have VPN working). My problem is that it appears to be working but its not working. I can open my Windows Explorer (from the SLAVE side network) and reach the MASTER, authenticate and open files. The MASTER NRM VPN monitor shows 1 (one) Active Connections 0 (zero) Packets Received and lots of Packets Sent. The VPN Member List Status shows both servers as �Being Configured�. The Audit Log has two recurring RED entrie...

Client-side Valdiation Not Working in IE?
For some reason, the Time Tracker's client-side validation isn't working on the login form of my site. It works fine when I run it from my local site. When I try to login, I can tell that both validators execute correctly via the VS.NET debugger, but it is still returning false for some reason in the "onSubmit" handler of the form. Anyone encounter this before?http://trycatchfail.com - Failure for everyone!...

Web resources about - My javascript code is working in IE and its not working in any other browser - asp.net.client-side

JavaScript Kit- Your comprehensive JavaScript, DHTML, CSS, and Ajax stop
Your comprehensive JavaScript, DHTML, CSS, and Ajax stop

Let's Code: Test-Driven Javascript by James Shore — Kickstarter
James Shore is raising funds for Let's Code: Test-Driven Javascript on Kickstarter! A screencast series focusing on rigorous, professional Javascript ...

Eloquent JavaScript: A Modern Introduction to Programming
... and pragmatics. I loved the tutorial-style game-like program development. This book rekindled my earliest joys of programming. Plus, JavaScript! ...

Lightbox (JavaScript) - Wikipedia, the free encyclopedia
On a Lightbox-enabled page, a user can click an image to have it magnified in a Lightbox window, which resizes itself according to the size of ...

Open Directory - Computers: Programming: Languages: JavaScript: Tools: Obfuscators
about dmoz - help Top : Computers : Programming : Languages : JavaScript : Tools : Obfuscators Tools for obfuscation/compression JavaScript code. ...

Facebook File-Transfer App Pipe Relaunches, Now Works Via JavaScript, WebRTC
... allowed Facebook users to send and receive files up to 1 gigabit in size. A new version of Pipe debuted Monday, and the app now works via JavaScript ...

Under the Hood: The JavaScript SDK - The use of polyfills - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Under the Hood: The JavaScript SDK - The use of polyfills geschrieben. Du kannst den vollständigen ...

JavaScript SDK - Facebook-Entwickler
Overview The JavaScript SDK provides a rich set of client-side functionality for accessing Facebook...

Senior Front-End Developer (Javascript and AJAX)
Company: Sometrics Category: Software Development Location: Los Angeles, CA How to Apply: jobs@sometrics.com Description: We are looking for ...

Badass JavaScript (@badass_js) on Twitter
WebGLWorker is an open source library that allows using WebGL from Web Workers. Great work as always from @kripken . blog.mozilla.org/research/2014/… ...

Resources last updated: 12/25/2015 1:05:05 PM