[SOLVED] - How to get Javascript run in FireFox ?

JavaScript and client side scripting.

Moderator: General Moderators

User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Okay.....Now I've loaded FireFox (since its mozilla's product anyway). Yes I was testing ONLY in IE all this time (and even worse only ver 6). Only when my ex-classmate told me about FireFox did I come to realize all this. I dont understand - All this time I was refering to Netscape's Java Central for javascript since they are the inventors of it so I figured there wouldn't be problems in other browsers supporting JS.
Now where am I supposed to get started regarding the actual JS implementation ? Im afraid if FireFox will secretly load other stuff in the background (like Kazaa) for updates or whatever. Many OSS do that.
Thanks for enlightening me on this subject.
User avatar
Jean-Yves
Forum Contributor
Posts: 148
Joined: Wed Jul 02, 2003 2:13 pm
Location: West Country, UK

Post by Jean-Yves »

No, Firefox does not install Spyware. The only feedback tool it installs is in case of crashes (for reporting these to the bug-fixing team), and even this is optionally installed.

I agree with others here: Develop in Firefox but ensure that you test for IE.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

I've loaded FireFox and obviously my JS are not working. I was looking for some good examples for writing standard JS code and I clicked FireFox Help which has many JS functions working in the browser. I wanted to view the JS files stored in the hard disk but could not find them in Temporary Internet Files. Where does FireFox cache ?
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

with firefox I strongly suggest you to download the Devloper tool bar (go on TOOLS-> Extension)
as a devloper it's an AMAZING tool to have!

ps : I know i'm not helping on your current probleme but it would help for the futur
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Yes I did install the develoer tool as well.
I've to get used to it. All this time I was using VS.NET and still use it since its so common.

Does anyone know whats the actual name for event ?
I keep getting event undefined in FireFox.
Originally it was event. Now I tried Event, window.event etc but no luck
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

Are you trying to make rollovers ?
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Yes. See the output of http://www.vlbjcas.com in IE6. The same wont work in FireFox. Thats what Im trying to do. In the JS file I have :

Code: Select all

function MainMenuEvent(srcId,event)
 { 	
 	switch (event.type)
 	 {
 	 	case "mouseover":
 	 	srcId.style.color="#006600";
 	 	srcId.style.backgroundColor="#99cc00";
 	 	break;
 	 	case "mouseout":
 	 	srcId.style.color="#99cc00";
 	 	srcId.style.backgroundColor="#006600";
 	 	break;
 	 }
 }
FireFox keeps showing event undefined in all lines. I've looked up Netscape's Javascript central too but could not find what Im suppossed to be looking for
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

Code: Select all

if (document.images) 
{
// nav menu
	img1on = new Image(); 	img1on.src = "images/btn_1_over.gif";
	img2on = new Image(); 	img2on.src = "images/btn_2_over.gif";
	img3on = new Image(); 	img3on.src = "images/btn_3_over.gif";

	img1off = new Image(); 	img1off.src = "images/btn_1.gif";
	img2off = new Image(); 	img2off.src = "images/btn_2.gif";
	img3off = new Image(); 	img3off.src = "images/btn_3.gif";
}

function act(imgName) {
	if (document.images) {
		documentїimgName].src = eval(imgName + 'on.src');
	}
}

function inact(imgName) {
	if (document.images) {
		documentїimgName].src = eval(imgName + 'off.src');
	}
}
Then in you html pages that's where you put

Code: Select all

<a href="some_page.php" onmouseover="act('img1')" onmouseout="inact('img1')"><img src="images/btn_1.gif" alt="some_image" border="0" name="img1" /></a>
You understand ?
PS : note that I assigned the name on each img. So it load the right "over"

EDIT : typo
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Wait a second. I did not check your code yet. But first I want to know is that why has this nothing do with the event object. All I need to change in my script is the way event handles. Once the event thing works I'll have rest of the code as usual. Im sure FireFox has event object defined. Its mentioned in w3c.
I've already used styles in most of my scripts. I just need to keep changing their values. Its much easier. Lets say my rollovers doesn't require images. Just style colours,underlines,textedcorations etc etc.
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

If it's only roll on underline and stuff CSS is your buddy (ps :I'm at work so I didn't test anything from your site)
So I'm just giving youthe way I used to make rollovers (wich work cross browser)

Maybe I'm not helping you at all..
sorry if it's the case ;)
Ps : here an exemple of css rolls here
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Finally all my questions are answered.
Must check out link : http://www.quirksmode.org
Can you believe it. This site it specially meant for IE6 incompatibility issues. Someone please include this in tutorial section or where ever required.
This is REALLY good.
Post Reply