adding javascript to a page
-
Hi all,
I am a WP newbie adding javascript to a page. Below is a full working html non wP page – and I would like to get something like it working on a WP page. When I copy the text inside the body tags below – then paste in to WP TEXT AREA – it does not do anything…
Q: How Do I get this javascript working?
THANKS – DAVE
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>dshow</title> <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile.structure-1.4.5.min.css" /> <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> </head> <body> <br><br> <p align=center> test 1 this line will always show<br><br><br> </p> <div align=center id="test1"> here is some stuff<br><br> some link <a href="page1.html" rel="external">click this</a> <br><br> and more stuff [wpbb post:acf name=‘edl’] </div> <script> $(document).ready( function(){ var sometest = '1'; //var sometest = '0'; if ( sometest == '1' ) { $("#test1").hide(0); $("#test1").show(2000); }else{ $("#test1").hide(2000); } } ); </script> </body> </html>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘adding javascript to a page’ is closed to new replies.