andoneyoung
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Adding simple Javascript to pagesIt works exactly like PBP_Editor explained it above, he just didn’t walk you through every single detail. I will use your code from above to help explain.
You still need the link to weather.com in your html code
‘<div id=”wx_module_3966″>
Malibu Weather Forecast, CA
</div>’
Note for above, I’m new to all of this, but the code is not showing correctly above. It shows the link, but in your html code you need the entire href from the original weather.com code.Next create an external java script using Notepad. Here is a link I found if you are unsure of how to do that. Link
In the java script file include everything in between ‘<script type=”text/javascript”>’ and ‘</script>’, but do not include the tags you will use them later.
Upload your java script file to your server, it should be in the root directory for the website. If you want to put it in a new separate folder that is fine, just take note of where you put it, how you spell it, and how you space it and capitalize it. One difference will prevent the code from working.
Now go back to your page and the html editor. This is where you insert your tags again. Insert the code
‘<script type=’text/javascript’ src=’http://yoursite.com/js/weather.js’></script>’Note that /js/ is the folder the file is in. When I uploaded my .js file I put it in a separate Weather folder so instead I used /Weather/weather.js. Again this script is very picky. If you have capitals in your file name you need to place capitals in the code.
I hope this helps, good luck, and pay it forward.
You can check out the results on my page. Protuber.com