dominoGuru.com

Your Development & Design Resource

An Attempt at Dynamic Content via Javascript

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 Key
Invalid 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!


About the author: Chris Toohey

Thought Leadership, Web & Mobile Application Development, Solutions Integration, Technical Writing & Mentoring

A published developer and webmaster of dominoGuru.com, Chris Toohey specializes in platform application development, solutions integration, and evangelism of platform capabilities and best practices.



More from dominoGuru.com


dominoGuru.com is powered by IBM Notes Domino XPages & hosted by Prominic.NET

Contact Us

Use our Contact / Feedback form or one of these email addresses:

Creative Commons License

Except where otherwise noted, dominoGuru.com by Chris Toohey is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.