It is currently Thu Mar 28, 2024 10:55 am


All times are UTC


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: JavaScript questions
PostPosted: Sat May 07, 2005 10:49 pm 
Noobie
Noobie

Joined: Fri Apr 22, 2005 1:00 am
Posts: 8
Location: NS, Canada
Well not quite, but I'm working on a new comic viewing system for me website, and I want to use JavaScript to make certain parts of it.

I'm having trouble making a bit of text change through a handful of predefined strings stored in an array. I want it to go from one to the next when you push a button and back to the last one when you push another. I'm getting nowhere fast, being much more comfortable with PHP. Anyone out there understand what I'm saying?

_________________
Blueglasscomics.com - A community of web comic fans and authors.


Last edited by Adamd on Sun May 15, 2005 9:34 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon May 09, 2005 10:18 pm 
Noobie
Noobie

Joined: Fri Apr 22, 2005 1:00 am
Posts: 8
Location: NS, Canada
I seem to have resolved many problems on my own, but a question remains.

Code:
var test= new Array("Blah","Wakka Wakka","One malt");

function test(input){
return test[input];
}


Would test[0] come up with "Blah" or do I need to do something to make the array available inside the function?

_________________
Blueglasscomics.com - A community of web comic fans and authors.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 9:38 pm 
Noobie
Noobie

Joined: Fri Apr 22, 2005 1:00 am
Posts: 8
Location: NS, Canada
I have yet another question that I'm going to bother posting.

Is there a function for JavaScript like that of isset() in PHP? It checks if a variable has data and returns true or false depending on that.

_________________
Blueglasscomics.com - A community of web comic fans and authors.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 17, 2005 9:07 am 
Experienced
Experienced

Joined: Fri May 13, 2005 10:24 am
Posts: 54
there is no isset function, however most variables will have been defined which means you can just check there type:

Code:
if(typeof UnknownVar != "undefined"){
  //set.
}else{
  //unset.
};


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 18, 2005 1:19 am 
Noobie
Noobie

Joined: Fri Apr 22, 2005 1:00 am
Posts: 8
Location: NS, Canada
I've gotten the frame work of what I was making working, but now for things like buttons that disapear when not needed. I plan on haveing the function that changes things call another function that sets the buttons CSS desplay property to hidden when it meets certen qualitys. Seems pritty simple... So I'll probably have more questions soon.

_________________
Blueglasscomics.com - A community of web comic fans and authors.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ]  Moderators: fhmagic, KJ, Moderators, Support Team

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
100WebSpace © 2011