Online Promoters™ :: Web Development made simple

Tag Archives: javascript

Setting & Getting background position with Prototype, Javascript

Getting the background position of a css element with prototype (javascript framework) is a bit tricky. Usually in all the good browser we refer to the background position of a css element by 'background-position'. As you probably know there usually is one shitty browser which always needs some "special attention" and several lines of code added just to work. Our today's example follows the pattern....

by Webmaster

Prototype IE7 error – evalScripts crash

Let's assume that you load some content - that contains javascript code - into a div using prototype's Ajax.Updater. You may want that javascript code, from the ajax response, to be evaled. So, you would do something like: [sourcecode language="js"] <script language="JavaScript" type="text/javascript"> new Ajax.Updater('the_div_id','/php_page',{evalScripts:true, onFailure: show_error}); </script> [/sourcecode] The error thrown by IE7 ironically is generated by the comment lines :[sourcecode language="html"]<!-- ... //...

by Webmaster