I'm having a comic problem while trying to add js code with an "</ul>" in it (its connected to InviteMod but broke it a bit down to make it easier to understand).
Example1:
Code: [Select] This one works as it should, we have an alert with the message "<ul>"
Example2:
Code: [Select] This one works not, even if its nearly the same as in Example1.
I dont really know whats going on there but it looks like something deletes stuff after
the </ul> tag.
Code: (html output) [Select] Some more things that i discovered:
- It works when the user is not logged in
- Tested it on multiple hosts, on one it works but on the others not
- Its the same when i add it manually to $context['footer_js'] (perhaps some parse functions doing stuff with it...)
Workarounds:
This one is not really nice but works.
Code: [Select]
And this one is what made me a bit confused. A simple escape of the / did it. I have no idea why, perhaps someone can explain it to me :D
Code: [Select]
EDIT: omg... looks like there are some troubles displaying this :D
Example1:
add_js("alert(\"<ul>\");");
Example2:
add_js("alert(\"</ul>\");");
I dont really know whats going on there but it looks like something deletes stuff after
the </ul> tag.
<script>
...
});alert("</ul>
<div id="junk">
<strong>Templates</strong> (5):
...
</script>
- It works when the user is not logged in
- Tested it on multiple hosts, on one it works but on the others not
- Its the same when i add it manually to $context['footer_js'] (perhaps some parse functions doing stuff with it...)
Workarounds:
This one is not really nice but works.
print "<script>alert(\"</ul>\");</script>";
And this one is what made me a bit confused. A simple escape of the / did it. I have no idea why, perhaps someone can explain it to me :D
add_js("alert(\"<\/ul>\");");
EDIT: omg... looks like there are some troubles displaying this :D