Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Ajax
|
Ajax the combination of XHTML, CSS, DOM, XML, XSLT, XMLHttpRequest, and JavaScript
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ajax section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 21st, 2006, 01:27 AM
Registered User
 
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ajax and javascript loading

Hello,
I'm using Ajax to load javascript functions and also HTML. In this HTML there is event like onkeyup that use the javascript function loaded. The code is added with an innerHTML = responseText.

When I don't use the Ajax loading everything works fine. I have read the Ajax pattern Javascript on Demand and then use an eval method. But still, I don't understand why it doesn't work.
I am looking for a simple example that works.

Those Javascript methods use the DOM to access the new loaded HTML code.
I wonder if it would be better to use responseXML to add the HTML code with another method instead of innerHTML.

About eval, how should I register my new functions ?
I've written self.myfuncname = function (myparam1, myparam2) {mycode here;}
is it OK ?

Then in my HTML code how do I use it ? onkeyup="myfuncname(param1,param2)" is it OK.

Thanks,








Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax- loading content spacecraft Ajax 2 May 3rd, 2007 06:29 AM
Loading Javascript in Flashmovie marcakesson Flash (all versions) 2 February 19th, 2007 01:47 PM
javascript popup keeps loading Dj Kat Javascript How-To 2 January 3rd, 2006 10:22 AM
dynamically loading table using javascript bkalyanchakri Javascript How-To 1 November 1st, 2005 07:21 AM
Navigate XML when loading with Javascript. awetch XML 1 February 24th, 2005 03:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.