Widget Javascript codes keep interracting
2 posters
Page 1 of 1
Widget Javascript codes keep interracting
Im making Javascript and HTML coding within one widget, however, diffrent parts of coding are interracting with each other, im making buttons that change the words above them, but the buttons are making the wrong words change and into the wrong new statement.....
then i tried putting them in seperate widgets, but they STILL interracted with each other on the homepage...
this is the code im using for the first button:
here is the code for the second one,
but they keep interracting with each other, and also, i want to combine them into one widget, ive tried to do this, but its still the same problem occuring
please help me
then i tried putting them in seperate widgets, but they STILL interracted with each other on the homepage...
this is the code im using for the first button:
- Code:
<span style="font-size: 10px; line-height: normal">
<head>
<script>
function myFunction()
{
document.getElementById("a").innerHTML="AWCA: Willowstorm,Ravenstar,<br>Oceanstorm,Hazelflower,<br>Spottedleaf,Dovewing,<br>Petalpelt,Eaglestar";
}
</script>
</head>
<p id="a">The AWCA is an Amazing group of Warrior RP forums, AWCA(awesome warrior cats aliance) is a forum cluster</p>
<button type="button" onclick="myFunction()">AWCA leaders</button>
</script>
here is the code for the second one,
- Code:
<span style="font-size: 10px; line-height: normal">
<head>
<script>
function myFunction()
{
document.getElementById("staff").innerHTML="Willowstorm,Ravenstar,<br>Oceanstorm,Hazelflower,<br>Spottedleaf,Dovewing,<br>Petalpelt,Eaglestar";
}
</script>
</head>
<p id="staff">Warriorclan staff are<br> Always about, and ready to help!</p>
<button type="button" onclick="myFunction()">Staff list</button>
</script>
but they keep interracting with each other, and also, i want to combine them into one widget, ive tried to do this, but its still the same problem occuring
please help me
Last edited by Ravenstar on September 30th 2012, 7:52 am; edited 1 time in total
Re: Widget Javascript codes keep interracting
here is the forum link: http://warriorclan.forumotion.com/
now, go to the widgets on the right, and then look down untill you see the widgets with the buttons "AWCA" and "staff list:"
and if u click on them, they make the wrong thing happen.
thats the problem
now, go to the widgets on the right, and then look down untill you see the widgets with the buttons "AWCA" and "staff list:"
and if u click on them, they make the wrong thing happen.
thats the problem
Re: Widget Javascript codes keep interracting
myFunction needs to have two different names. myFunction and myFunction2
also you did not insert a use strict in your code.
also you did not insert a use strict in your code.
- Code:
function myFunction() {
"use strict";
document.getElementById("staff").innerHTML="Willowstorm,Ravenstar,<br>Oceanstorm,Hazelflower,<br>Spottedleaf,Dovewing,<br>Petalpelt,Eaglestar";
}
- Code:
function myFunction2() {
"use strict";
document.getElementById...
Re: Widget Javascript codes keep interracting
Never mind Everyone!
my father showed me how, i needed to change
the "Function myFunction()"
to "Function (ID word)Function"
u can toss this into the garbage or something now
my father showed me how, i needed to change
the "Function myFunction()"
to "Function (ID word)Function"
u can toss this into the garbage or something now
Similar topics
» javascript codes
» Javascript Codes don't work
» Some JavaScript codes are not working
» Javascript codes issue
» 2 Javascript Codes on same post
» Javascript Codes don't work
» Some JavaScript codes are not working
» Javascript codes issue
» 2 Javascript Codes on same post
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum