473,499 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript works in Firefox but not in IE

145 New Member
view source for I.E. and firefox shows following
Expand|Select|Wrap|Line Numbers
  1. <script src="script.js" type="text/javascript"></script>
but only working in firefox. Getting "object expected" error for internet explorer.

I am using masterpage so I am registering the script.js on load of the content page.

Expand|Select|Wrap|Line Numbers
  1. ClientScriptManager Jscript = Page.ClientScript;
  2. Jscript.RegisterClientScriptInclude(this.GetType(), "ScriptInFile","script.js");
  3.  
Apr 4 '09 #1
4 4804
dorandoran
145 New Member
call me crazy but all of the sudden it's working in both IE and Firefox. (well, I basically restarted the IIS, the asp.net built in IIS). and I checked the box "Always display something something" when I javascript error happend "object expected", after that it started working. I then went to IE > tools> internet options > advanced > and unchecked the "Display a notification about every script error.".

then I went back to browser and checked the functionality and they seem to be working both in IE and Firefox.

I still want to learn what fixed my IE issue. I understand IE and firefox handles javascript differently.
Apr 4 '09 #2
gits
5,390 Recognized Expert Moderator Expert
currently you just avoid the error-notification in IE, and i strongly guess that the error comes from the script itself ... not simply from the include ... so to say something, we would need to know what the script will do and see the code to tell you what could be wrong ...

kind regards
Apr 5 '09 #3
dorandoran
145 New Member
Firefox works as expected. IE is only displaying fname not the contenate name. Also, no alert is pops up with IE.

This is my script.js

Expand|Select|Wrap|Line Numbers
  1. function openMyWindow()
  2.     var myID = document.getElementById('ctl00_maincontent_txtEmpID').value;
  3.     var sName = document.getElementById('ctl00_maincontent_txtfname').value & " " & document.getElementById('ctl00_maincontent_txtlname').value;
  4.     var url = 'assign_dept.aspx?id='+myID+'&sName='+ sName;
  5.     alert(sName);
  6.     window.open(url,'welcome','width=400,height=250');
  7. }
  8.  
Here is the link
Expand|Select|Wrap|Line Numbers
  1. <a href="javascript:;" onclick="openMyWindow();return false">Open My Window</a>
  2.  
Apr 5 '09 #4
gits
5,390 Recognized Expert Moderator Expert
in your line 4 fix the concatenation of the string ...

kind regards
Apr 6 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

14
5419
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
4
2309
by: lmarceglia | last post by:
Hi, I have this website that doesn't work in Firefox 1.5: www.pianetaluca.com The HTML source is: <TITLE>PianetaLuca</TITLE> </HEAD>
1
1463
by: nitinp | last post by:
hello, I am trying to validate empty textbox value by javascript in Firefox. It is working fine in IE but not in Firefox. Note - code is for ASP.NET <script runat="server"> protected void...
6
1866
by: davidiwharper | last post by:
Hi there. I'm putting together a page to collect some information from our website users and send the administrator an email. To this end I have some Javascript form validation in an external...
8
2159
by: sultanwadood | last post by:
Hi all. I need to know how to disable javascript through javascript in firefox. thanks in advance if some one could help me. Sultan Wadood.
1
6591
by: aal | last post by:
Hi experts, How would look the following IE javaScript in Firefox? var wrd = new ActiveXObject("Word.Application"); var excl = new ActiveXObject("Excel.Application"); Thanks aal
3
1338
by: hardcorey | last post by:
i basically have a couple songs that ive made on my site, and im using an onClick event to play each song. basically the onClick event calls the javascript function. heres my javascript: ...
15
1614
by: qwarehouse | last post by:
Hello, I am having an issue with javascript in firefox. On this URL, there should be a menu displayed above a dashed line. Works ok in IE6 & 7 but no menu displays in firefox. Any sugestions? ...
1
1306
by: Louis | last post by:
Thanks in advance for any comment and suggestion... On one of my web pages, I use javascript to pop up a context menu box when the right-mouse button is clicked on a link. It works fine in...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7012
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7225
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4920
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3105
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.