Title: Help with my first java script attempt
Last modified: August 20, 2016

---

# Help with my first java script attempt

 *  [drsanders2k](https://wordpress.org/support/users/drsanders2k/)
 * (@drsanders2k)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/help-with-my-first-java-script-attempt/)
 * I have extracted some js code from a working non-WordPress page, and I’m trying
   to make it work on my site. It defines a function and then executes a URL with
   a callback to that function. I can run the URL without the callback and I see
   the data I’m trying to access. It appears that the callback is not executing 
   my function, as the data never gets displayes. Can someone help me get off square
   one? I’m a js novice, so be kind! 🙂
 * Here are the entire contents of my page:
 *     ```
       <html>
       <head>
       </head>
       <script type="text/javascript" >
       function showEvents(json){
       var statusHTML = [];
       	for (var i=0; i<json.length; i++) {
       		var p = json[i];
       	    statusHTML.push('<table cellpadding="0" cellspacing="0">');
       		for (var j=0; j<p.length; j++) {
       			var sd = Date.parseDate(p[j].STARTDATE, "F, d Y g:i:s");
       		    statusHTML.push('<tr><td class="StartDate">'+ sd.dateFormat("F d") +'</td></tr>');
       		    statusHTML.push('<tr><td class="Event"><a href="##" onclick="goView('+p[j].EVENTID+');">'+p[j].EVENTNAME+'</a></td></tr>');
       		    statusHTML.push('<tr><td><hr size="1" color="#005daa"></td></tr>');
       		}
       	    statusHTML.push('</table>');
         	}
        document.getElementById('Events').innerHTML = statusHTML.join('');
       }
       statusHTML.push('</table>');
       }
       document.getElementById('Events').innerHTML = statusHTML.join('');
       }
       </script>
       <body>
       <p></p>
       <h3>EVENTS:</h3>
       <div id="Events">Loading...</div>
   
       <script src="http://www.IsMyRotaryClub.org/Event/Event.cfm?AccountID=6860&Mo=3&callback=showEvents" type="text/javascript">
       //<![CDATA[//]]>
       </script>
       </body>
       </html>
       ```
   

The topic ‘Help with my first java script attempt’ is closed to new replies.

## Tags

 * [callback](https://wordpress.org/support/topic-tag/callback/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [drsanders2k](https://wordpress.org/support/users/drsanders2k/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/help-with-my-first-java-script-attempt/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
