Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

JS and Page Scripts

10 years ago
I tried inputting the script below into $PAGETEXT, using $PAGETEXT := $PAGETEXT + "(text)". Needless to say, the extra quotation marks made the script invalid. This is a show/hide button that will appear on my party management page and display information on a character when the character's name is clicked. Is there any way to make it work.

<script language="javascript">
function showOrHide()
{
var div = document.getElementById("showOrHideDiv");
if (div.style.display == "block")
{
div.style.display = "none";
}
else
{
div.style.display = "block";
}
}
</script>

<a href="javascript:showOrHide();">Garret</a>
<div id="showOrHideDiv" style="display: none">An elderly mystic who saved you from the ruins of an abandoned city. His skills in medicine and mana manipulation are phenomenal.</div>

JS and Page Scripts

10 years ago
@BerkaZerka, thank you for your hasty response. You caught me right as I was editing, though, and I had to go back and retype all my code, minding the special characters, of course. Still, no harm done, and I am glad to see your willingness to help me.

JS and Page Scripts

10 years ago
Yeah - you just have to use ' in place of " inside the outermost "s.

JS and Page Scripts

10 years ago
Hmm, I thought that for a second, but I wasn't sure. Thank you very much.

JS and Page Scripts

10 years ago
I know it works for pic and youtube parameters. Curious if it will handle javascript correctly. Let us know :)

JS and Page Scripts

10 years ago
Yes, it works like a charm. Well, better than a charm really, since most charms are based off of unfounded and superstitious claims of enhanced luck and wellbeing that could easily be chalked up to sheer coincidence.