Title: Yahoo User Interface and WordPress, Javascript Array Problem
Last modified: August 19, 2016

---

# Yahoo User Interface and WordPress, Javascript Array Problem

 *  [WhisperPress](https://wordpress.org/support/users/whisperpress/)
 * (@whisperpress)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/yahoo-user-interface-and-wordpress-javascript-array-problem/)
 * I’m using a YUI 2 calendar widget within a wordpress installation, and have a
   problem printing a date array.
 * Here are the configuration options of the calendar, to see how the dates are 
   passed as a non-array, for example “11/12/10,04/12/11”
    [http://developer.yahoo.com/yui/calendar/#config](http://developer.yahoo.com/yui/calendar/#config)
 * Here is the code I’m using, with an anonymous function:
    [http://pastebin.com/qASAsxGh](http://pastebin.com/qASAsxGh)
 * When the page loads, it’s completely blank except for the date_array which is
   printed at the top of the page. Does wordpress need some additional work around
   for this to function?
 * I’ve already done enqueues for several other javascript pieces, however I find
   it strange that the calendar loads perfectly with the dates highlighted if I 
   pass in “11/12/10,04/12/11”, but does not work if I try to use the function DateAnon()
 * [http://pastebin.com/i6vQv6n4](http://pastebin.com/i6vQv6n4)
 * I appreciate any and all help!
 * WP

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [WhisperPress](https://wordpress.org/support/users/whisperpress/)
 * (@whisperpress)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/yahoo-user-interface-and-wordpress-javascript-array-problem/#post-1668640)
 * I found the answer thanks to blast007 in #YUI on the freenode IRC.
 * if you do a document.write after the page is loaded, it will overwrite your entire
   page
 * you probably want to have a placeholder element (say, a div) that you then manipulate
   the contents of – or maybe you really just want to send that data to a debugger
   like Firebug
 *  Thread Starter [WhisperPress](https://wordpress.org/support/users/whisperpress/)
 * (@whisperpress)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/yahoo-user-interface-and-wordpress-javascript-array-problem/#post-1668646)
 * Best Answer:
 * Use DOM Manipulation methods instead of document.write
 * [http://stackoverflow.com/questions/802854/why-is-document-write-considered-a-bad-practice](http://stackoverflow.com/questions/802854/why-is-document-write-considered-a-bad-practice)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Yahoo User Interface and WordPress, Javascript Array Problem’ is closed
to new replies.

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [calendar](https://wordpress.org/support/topic-tag/calendar/)
 * [dates](https://wordpress.org/support/topic-tag/dates/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [svg](https://wordpress.org/support/topic-tag/svg/)
 * [wp_enqueue_scripts](https://wordpress.org/support/topic-tag/wp_enqueue_scripts/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 1 participant
 * Last reply from: [WhisperPress](https://wordpress.org/support/users/whisperpress/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/yahoo-user-interface-and-wordpress-javascript-array-problem/#post-1668646)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
