dominoGuru.com
Your Development & Design Resource
An Attempt at Dynamic Content via Javascript
11/21/2005 12:48 PM by Chris Toohey
It's a simple enough chore really - dynamic DHTML based on QueryString parameters, and run by Javascript (non-Domino backend, wouldn't ya know!). It's turning into a ranting hate for Internet Explorer possibly fueled by a hiccup in my code or a lack of knowing about some security lockdown that was released at 3:27AM last night from Redmond! Here' the gist - see if you can figure it out!
Without much further ado - this is what I'm doing:
Using the QueryString parser found here, I call a function that's designed to check the current QueryString for the key that I pass, see if it has a value, and see if that value has a correlating "function" (via a switch function) all to set the innerHTML of a given element. Because I wouldn't know what the heck someone was talking about from reading that last line, here's a live example showing what I'm trying to accomplish:
No KeyInvalid Key
Va lid Key
Now, if you open that link, you'll get an alert (at least at the time of this publishing) telling you that there's no function trigger... because there's not. Using the QueryString ?Open&val=something would return either the correlating function, or a prompt letting you know that your function, while it was defined, wasn't found in the list.
Now, I've got this thing working wonderfully in Mozilla and
Opera, but I get a nasty runtime error in Internet Exploder
Explorer.
Can you see what I don't?!
Update
Something should be said for giving your brain a day's break from any issue!
While I was posting a reply to Vince, I happen to look at the markup for my example
again. As I wanted to reference the ID of the <div>
-tag that
I used, I found that I had actually used a <p>
-tag, which
wouldn't handle a now-nested paragraph via the innerHTML method. After changing
the <p>
to a <div>
, it began working as
designed!