473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

cant invoke a function loaded thru a string

Hi,
I load some javascript functions through a string in to a div of a html file

also i set an onclick event to a td thru setAttribute.

This works fine if there is just an alert or a scripts without functions (in this case the string is passed asit is).

the string is with function and statement inside it is written inside a div with creating script tags at he begging and end . Now When i assing the function to the td thru setAttribute the function inside the div is not called.

I tried it to insert into the Head tag also even then its not working.

the error is : the function is not defined.


Any Suggestions PLS
.... Looking Forward.
Jun 18 '07 #1
1 1385
Hi,
I load some javascript functions through a string in to a div of a html file

also i set an onclick event to a td thru setAttribute.

This works fine if there is just an alert or a scripts without functions (in this case the string is passed asit is).

the string is with function and statement inside it is written inside a div with creating script tags at he begging and end . Now When i assing the function to the td thru setAttribute the function inside the div is not called.

I tried it to insert into the Head tag also even then its not working.

the error is : the function is not defined.




Any Suggestions PLS
.... Looking Forward.

The Code
***********

function external(){
var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.onload = testfn;
headID.appendChild(newScript);
}

if (xmlhttp.readyState == 4){
var response = xmlhttp.responseText;
var thisdoc = xmlhttp.responseXML;
var domParser = new DOMParser();
var xmlroot = domParser.parseFromString(response,'application/xml');
if(xmlroot.selectSingleNode("//ProductsData/test")){
testfn = xmlroot.selectSingleNode("//ProductsData/test/text()").nodeValue;
external();
document.getElementById("content1").setAttribute(" onClick",xmlTest());
}
}

Thanks in advance..
Looking Forward for a reply
Jun 18 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Yves Dhondt | last post by:
Hello, I'm looking for information about the loading/unloading of unmanaged dlls. Using the debugger I think it works as follows : the unmanaged DLL is loaded as soon as a call to one of it's...
2
by: Martin Maat | last post by:
Hi, I am trying to create a plug-in assembly without the need to register it in the GAC. Reflection should help me out here. I got this far: private void button1_Click(object sender,...
5
by: RickDee | last post by:
Please help, anybody. I am trying to write a program so that it can launch an exe file ( which is also genereated in C# ) and then simulate the button clicking and invoke the methods inside the...
4
by: gilad | last post by:
If a DLL has been created to be thread-safe, and you create a wrapper class around it in C# that is non-static (i.e. you must instantiate objects from it), what are the implications of creating...
3
by: Manfred Braun | last post by:
Hi All, I am able to invoke some methods from an instance of a loaded assembly, but I am not able to invoke the loaded assemblie's "Main" method. I try it this way: Assembly assembly =...
3
by: Jassim Rahma | last post by:
Hi, I have MDI Child called MDIChild_! and I want if the user click on the button which shows that form to invoke the same openned form not a new form everytime unless it's not openned then it...
5
by: Steve Richter | last post by:
In my user control I want to read the ViewState dictionary of the Parent control. But this sensible idea is not permitted by the compiler: Compiler Error Message: CS1540: Cannot access...
4
by: Martin Fletcher | last post by:
I cant get the Concat function to work, please help. Here's some of my code. Module modTCP Public TCP_RECEIVED_DATA As String Private WithEvents TCP_SERVER As New WinSockSVR Private Sub...
0
by: Pawan Narula via DotNetMonster.com | last post by:
hi all, i'm using VB.NET and trying to code for contact management in a tree. all my contacts r saved in a text file and my C dll reads them one by one and sends to VB callback in a sync mode...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.