Sleek Interactive
4159 Enquist Rd
Campbell River, BC V9H 1A4OFFICE: 778 420 3918
MOBILE: 250 204 6475
*content_window*Reserved words in Javascript "Content_Window" is not the only match in this case....
September 19th, 2011
scrollup(),scrolldown() is not a functionOdd Javascript behaviour scrollup(),scrolldown() is not a function - possible reserved words...
August 31st, 2011
CSS !importantUsing !important with inline styles
August 28th, 2011
Custom CSS CursorsLearn how to add custom cursors to any CSS element in your website....
August 23rd, 2011
Social Networking Timestamp OperatorLearn to create a Timestamp Operator in PHP using the PHP Date function...
August 23rd, 2011
BLOG CATEGORY: Javascript | Permalink | 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;
}
BLOG CATEGORY: Javascript | Permalink | Posted on: August 31st, 2011 |
Although I have not found the answer, I thought I should at least document it as a possible bug.
I had a project that involved doing a scrolling area
I wrote a couple of simple functions to handle the jQuery and named them scrollup() and scrolldown(). I uploaded my changes and received the ERROR: scrollup() is not a function. I checked my spelling on the function and the call and everything looked fine. Exhausted all other traditional avenues for debugging and found nothing .... time went by ......
..... yep .......................
............. a lot of time went by ...... and then I decided I would try something different in desperation .... I renamed the functions scroll_up() and scroll_down() and ...... they work fine. WTF
Weird stuff. I imagine they are reserved by the browser (in this case all browsers had same issue) or something but can't find a whole lot of information on it. No traces of them being reserved here
