Sleek Interactive
4159 Enquist Rd
Campbell River, BC V9H 1A4

OFFICE: 778 420 3918
MOBILE: 250 204 6475

Recent Blog Posts

*content_window*

Reserved words in Javascript "Content_Window" is not the only match in this case....

September 19th, 2011

scrollup(),scrolldown() is not a function

Odd Javascript behaviour scrollup(),scrolldown() is not a function - possible reserved words...

August 31st, 2011

CSS !important

Using !important with inline styles

August 28th, 2011

Custom CSS Cursors

Learn how to add custom cursors to any CSS element in your website....

August 23rd, 2011

Social Networking Timestamp Operator

Learn to create a Timestamp Operator in PHP using the PHP Date function...

August 23rd, 2011

Blog Posts » Javascript »

*content_window*


BLOG CATEGORY: Javascript | Posted on: September 19th, 2011

Another stump today - a simple javascript function - or is it?

Well technically it was a very simple function - something like:

function set_content_window(url){

     document.getElementById('iframe_o_mine').src = url;

}

Simple enough right? Well not so. I got no errors just nothing at all - the worst kind of error is one that does not tell you it is there.

So I though the function name looked a bit system-like, so I changed it to:

function update_content_window(url){

     document.getElementById('iframe_o_mine').src = url;

}

Same thing - turns out the reserved name must be a wildcard match because just having the instance of "content_window" has no effect when defining a function with such a name. Odd! Updated once more to something silly like the one below and it worked as expected.

function any_other_function_name(url){

     document.getElementById('iframe_o_mine').src = url;

}

Close External Browser Window