Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Stupid javascript problems. Please help.

Author
Message
General Reed
19
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 16th Nov 2008 15:23
Hi all,
Im having a silly (probably noobesque) javascript problem. Basicly, im trying to include a .js file, and then use a function contained within that .js. However nomatter what i do, it does not seem to work. Here is the code:

Test.php


Test.js


It seems so simple to me, but it just wont work. Neither the onload method, or just the direct method. What am i missing out?

Cheers.

General Reed.

CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb

Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 16th Nov 2008 20:44
I might be wrong because I haven't touched JS in a while but shouldn't you use

SCRIPT LANGUAGE="...." instead of SCRIPT TYPE="...." ?

I can look at it more later if this doesn't solve anything.


Alsan
20
Years of Service
User Offline
Joined: 20th May 2005
Location: Germany - Nähe Kassel
Posted: 16th Nov 2008 21:13
Hiho,

I tested it in Opera 9.61, Firefox 3.0.3, Internet Explorer 6 and Netscape 7.1 and it worked just fine in all of them.

General Reed
19
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 17th Nov 2008 09:56
Ok thanks dudes i got it to work.

Now i have another problem.

Well more of a wondering. In ajax, you have to set the function it xmlhttp object runs, when an event occours like this:

xmlobject.onreadychange=myfunction;

Now im wondering if it is possible to do something along the lines of:

function setOnchange(var myXmlObject, var myFunction)
{
myXmlObject.onreadychange=myFunction;
}

I have a feeling that is incorrect, but is it possible to do something like that?

Cheers.

CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb

General Reed
19
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 17th Nov 2008 21:13
d/w Ive solved this.

Ok now i have yet another question. This time its to do with php.

Basicly, can i not use AND in an if statement? Because ive tried and it dosnt work. Ive also looked on google, and i cant seem to find a single article on using AND in a php if statement. If not then what rock were the php developers living under? lol

CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb

Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 17th Nov 2008 21:22
There is no AND keyword in C-scripted languages like PHP. You have to use:

&& = AND
|| = OR
! = NOT

e.g.

if(a == b && c == d)
{
// code
}


General Reed
19
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 17th Nov 2008 22:00
Ok thanks. I just assumed that becuase when you type "and" in dreamweaver, its highlighted.

CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb

Login to post a reply

Server time is: 2025-06-08 09:05:26
Your offset time is: 2025-06-08 09:05:26