Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Closed Thread
This is probably extremely simple!
Old 04-24-2010, 01:23 AM This is probably extremely simple!
Madman340's Avatar
Web Designer

Posts: 571
Name: Jared
Location: Florida
Trades: 1
edit: nevermind, fixed it.

Here is the code block I'm working with. I get a syntax error on the line where the var is declared.

Code:
<script>
var changeBG(t){
$('body').removeClass().addClass($("#bgchange").val());
}
</script>

<select name="bgchange" id="bgchange" onchange="changeBG(this);">
                <option value="bg1">BG 1</option>
                <option value="bg2">BG 2</option>
                <option value="bg3">BG 3</option>
</select>
Somebody is helping me with this, and now I'm running into this (hopefully) little issue. I'm guessing it needs to be declared as a function or something, but as I don't know javascript (this is the jQuery library btw) I really have no idea what to do.

I'm hoping for a speedy response! This is a very small project and I keep running into big problems.
__________________

Please login or register to view this content. Registration is FREE
for cheap hosting solutions.
Use the coupon code "SINGLECENT" to pay just a single cent for the first month!

Last edited by Madman340; 04-24-2010 at 06:29 AM..
Madman340 is offline
View Public Profile
 
 
Register now for full access!
Closed Thread     « Reply to This is probably extremely simple!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21750 seconds with 12 queries