473,513 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox javascript won't work (works in IE)

I have created an ascx control and I am calling
registerclientscriptblock. The path to the js file is relative to the
aspx page and not the ascx file. The function runs fine in IE7 but in
Firefox the error console says that the function is not defined. I
tried making a very basic js file to get it to work and I am having
the same problem. My js file is as follows

function testjs()
{
alert("test fired");
}

I look at the page source in Firefox and it looks correct
<script src="/JavaScript/test.js" type="text/jscript"></script>

My page that i am running is /test.aspx and the js file is located in /
JavaScript/test.js. I put an <inputon with onclick="testjs();" and
firefox says testjs is not defined. I am at a loss as to why this
won't work but works fine in IE. I am not doing any specific IE
functions.

Feb 14 '07 #1
2 9128
I think it should be

<script src="/JavaScript/test.js" type="text/javascript"></script>

(Note jscript --javascript). JScript is IE-specific stuff, so Firefox
probably ignores it because of the type
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


"Altman" <ba*****@easy-automation.comwrote in message
news:11**********************@m58g2000cwm.googlegr oups.com...
>I have created an ascx control and I am calling
registerclientscriptblock. The path to the js file is relative to the
aspx page and not the ascx file. The function runs fine in IE7 but in
Firefox the error console says that the function is not defined. I
tried making a very basic js file to get it to work and I am having
the same problem. My js file is as follows

function testjs()
{
alert("test fired");
}

I look at the page source in Firefox and it looks correct
<script src="/JavaScript/test.js" type="text/jscript"></script>

My page that i am running is /test.aspx and the js file is located in /
JavaScript/test.js. I put an <inputon with onclick="testjs();" and
firefox says testjs is not defined. I am at a loss as to why this
won't work but works fine in IE. I am not doing any specific IE
functions.
Feb 14 '07 #2
On Feb 14, 9:11 am, "Teemu Keiski" <jot...@aspalliance.comwrote:
I think it should be

<script src="/JavaScript/test.js" type="text/javascript"></script>

(Note jscript --javascript). JScript is IE-specific stuff, so Firefox
probably ignores it because of the type

--
Teemu Keiski
AspInsider, ASP.NET MVPhttp://blogs.aspadvice.com/jotekehttp://teemukeiski.net

"Altman" <balt...@easy-automation.comwrote in message

news:11**********************@m58g2000cwm.googlegr oups.com...
I have created an ascx control and I am calling
registerclientscriptblock. The path to the js file is relative to the
aspx page and not the ascx file. The function runs fine in IE7 but in
Firefox the error console says that the function is not defined. I
tried making a very basic js file to get it to work and I am having
the same problem. My js file is as follows
function testjs()
{
alert("test fired");
}
I look at the page source in Firefox and it looks correct
<script src="/JavaScript/test.js" type="text/jscript"></script>
My page that i am running is /test.aspx and the js file is located in /
JavaScript/test.js. I put an <inputon with onclick="testjs();" and
firefox says testjs is not defined. I am at a loss as to why this
won't work but works fine in IE. I am not doing any specific IE
functions.
OMG I cannot believe I didn't see that. Guess I need to pay more
attention to intellisense. I never used the jscript before I don't
know how I missed it now. Thanks.

Feb 14 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2205
by: LRW | last post by:
(Sorry if this is a repost...my newsreader keeps crashing on the posting--I don't know if the message going out or not) For some reason this javascript just won't work in Firefox. It works fine...
3
5151
by: David Hayes | last post by:
I've made tooltips work in Firefox*, but tooltip doesn't appear at the specified location until the SECOND time that the user passes the mouse over the location with the mouseover event. What I...
8
5620
by: Dominic Tocci | last post by:
I'm searching for a way to use window.open on my web page to open a window in firefox that allows the sidebars to work (bookmarks, history, etc). When I use the following: var...
3
2945
by: niconedz | last post by:
Hi The following code works fine in IE but not Firefox. It's a little script that zooms an image and resizes the window to fit. Can anybody tell me what's wrong? Thanks Nico == btw.....
2
3545
by: ranger7419 | last post by:
I'm trying to figure out why this script will work in IE 6 but not Firefox, and so I need someone here with a far better grasp on javascript to explain this. Basically, I have a page with several...
11
3407
by: minnesotti | last post by:
Hi there, I subscribed to a photographic pictures-hosting website which is heavy on JavaScript. My preferred latest browser Mozilla Firefox does not work with it -- no pictures are displayed and...
7
6448
by: 80s.arcade | last post by:
Hi. Please take a look at this page: http://tinyurl.com/s2l8w In IE6, putting the mouse on each of the two items highlights the word in a blue (different image) and shows a tool tip. In...
4
10305
by: Andre | last post by:
With Firefox 1.5+, I used the following code to close a window/tab: === <html><head> <script language="javascript" type="text/javascript"> function closeWindow() { window.open('','_parent','');...
3
2411
by: SAL | last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps section of either web.config or machine.config but it didn't work. It seems that most pages in my webapp are okay but a...
0
7260
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
7161
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
7539
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
7525
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...
0
5686
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3234
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...
1
802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
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.