Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

[SOLVED] Difficulty with Javacript weather embed on pages


 
Prev Previous Post   Next Post Next
  #1  
Old Dec 2, 2009, 12:53 AM
Wimbledon's Avatar
Wimbledon
 
320 posts · Apr 2009
[VA & AZ], USA
[SOLVED] Difficulty with Javacript weather embed on pages

I posted on the Wordpress.org forums here and so far have not been able to solve my problem.

According to this:
http://codex.wordpress.org/Using_Jav...Template_Files

Adding Javascript seems to be quite a hassle. I investigated the Inline JavaScript Plugin, but I don't want to disable my WYSIWYG editor.

I am trying to embed weather for various locations on different pages, and the weather.com embed fits my needs best. The problem is that it's Javascript, and I don't know how to turn this into PHP:

<div id="wx_module_3966">
<a href="http://www.weather.com/weather/local/USCA0660">Malibu Weather Forecast, CA</a>
</div>

<script type="text/javascript">

/* Locations can be edited manually by updating 'wx_locID' below. Please also update */
/* the location name and link in the above div (wx_module) to reflect any changes made. */
var wx_locID = 'USCA0660';

/* If you are editing locations manually and are adding multiple modules to one page, each */
/* module must have a unique div id. Please append a unique # to the div above, as well */
/* as the one referenced just below. If you use the builder to create individual modules */
/* you will not need to edit these parameters. */
var wx_targetDiv = 'wx_module_3966';

/* Please do not change the configuration value [wx_config] manually - your module */
/* will no longer function if you do. If at any time you wish to modify this */
/* configuration please use the graphical configuration tool found at */
/* https://registration.weather.com/ursa/wow/step2 */
var wx_config='SZ=300x250*WX=VWC*LNK=WWLD*UNT=F*BGC=e5 e5e5*MAP=CSC|null*DN=www.roadreview.net*TIER=0*PID =1135549517*MD5=1d1a5d81581d186caf25d5bea18bec5a';

document.write('<scr'+'ipt src="'+document.location.protocol+'//wow.weather.com/weather/wow/module/'+wx_locID+'?config='+wx_config+'&proto='+document .location.protocol+'&target='+wx_targetDiv+'"></scr'+'ipt>');
</script>

A member on the Wordpress.org forums posted:

---

Take the script code and save it as an external js. WordPress doesn't like the document.write directly in the post. Make sure you are in HTML edit mode.

So try this

<div id="wx_module_3966">
Malibu Weather Forecast, CA
</div>

<script type='text/javascript' src='http://yoursite.com/js/weather.js'></script>


---

Yet his advice did not work. I have tried setting the "Configure Javacript" setting in ATO to external, and that didn't change anything.

Any help is much appreciated!
 

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
embed phpbb forums using wp-united or otherwise? echamings Installing & running WordPress 6 Aug 16, 2010 02:31 AM
Making separate pages to display posts by category; also, how to embed WP page Eric Bobrow Atahualpa 3 Wordpress theme 1 Dec 2, 2009 12:34 AM
difficulty applying back ground Zed Header configuration & styling 3 Sep 13, 2009 10:33 AM
Embed Flash masterchief Atahualpa 3 Wordpress theme 0 May 18, 2009 08:42 AM
How to embed video in a post? Jody Post-Kicker, -Byline & -Footer 2 Mar 22, 2009 02:16 PM


All times are GMT -6. The time now is 08:41 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.