Difference between revisions of "Javascript"

From Bashlinux
Jump to: navigation, search
(Javascript)
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
== How to debug objects ==
+
=== How to debug objects ===
 
 
* To print out objects, even the ones coming from PHP, use Firefox or Google Chrome and the add to the code:
 
* To print out objects, even the ones coming from PHP, use Firefox or Google Chrome and the add to the code:
 
<pre><nowiki>
 
 
console.log(object)
 
console.log(object)
 
: Useful to see the object structure
</nowiki></pre>
 
 
Useful to see the object structure
 
 
== How to update html code and make it works on IE9 ==
 
   
 
=== How to update html code and make it works on IE9 ===
 
And probably in the rest of the Internet Explorer. The IE browsers are unable update the HTML code of any tag because probably it is being cached. In order to update a page in the properly way, just add a random number as a parameter to the page
 
And probably in the rest of the Internet Explorer. The IE browsers are unable update the HTML code of any tag because probably it is being cached. In order to update a page in the properly way, just add a random number as a parameter to the page
 
<pre><nowiki>
 
 
$(".tag").load("page.php?"+Math.random()*99999);
 
$(".tag").load("page.php?"+Math.random()*99999);
</nowiki></pre>
 

Latest revision as of 01:02, 7 June 2015

How to debug objects

  • To print out objects, even the ones coming from PHP, use Firefox or Google Chrome and the add to the code:
console.log(object)
Useful to see the object structure

How to update html code and make it works on IE9

And probably in the rest of the Internet Explorer. The IE browsers are unable update the HTML code of any tag because probably it is being cached. In order to update a page in the properly way, just add a random number as a parameter to the page

$(".tag").load("page.php?"+Math.random()*99999);