Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Firefox javascript won't work (works in IE)

Reply
Thread Tools

Firefox javascript won't work (works in IE)

 
 
Altman
Guest
Posts: n/a
 
      02-14-2007
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 <input> on 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.

 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      02-14-2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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 <input> on 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.
>


 
Reply With Quote
 
 
 
 
Altman
Guest
Posts: n/a
 
      02-14-2007
On Feb 14, 9:11 am, "Teemu Keiski" <(E-Mail Removed)> wrote:
> 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" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) 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 <input> on 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript does not work in Firefox minnesotti Firefox 31 07-09-2007 07:07 PM
JavaScript does not work in Firefox minnesotti HTML 13 07-18-2006 11:32 PM
Clientside filtering and sorting xml with javascript: Work in IEbut not Firefox Alan Searle XML 2 11-20-2005 03:11 PM
this javascript won't work in Firefox LRW Javascript 5 12-03-2004 10:46 PM



Advertisments