473,725 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

onClick() function not working when page is refreshed through AJAX

3 New Member
hi,

I am facing one problem which is related to AJAX. I have a html page which has some links. When the page is refreshed using AJAX then if some new new link is added to the page on this refresh, then the onClick function of this particular link is not working. Plz help
May 29 '07 #1
3 2339
r035198x
13,262 MVP
hi,

I am facing one problem which is related to AJAX. I have a html page which has some links. When the page is refreshed using AJAX then if some new new link is added to the page on this refresh, then the onClick function of this particular link is not working. Plz help
What is hapening on the refresh? You might have to show some code.
May 29 '07 #2
msinghal
3 New Member
What is hapening on the refresh? You might have to show some code.
I am trying to call a javascript function onClick of a calendar icon (which was rendered by AJAX) and I am getting JS error that the function is undefined (which I am trying to call on onClick)

Here is a code snipplet (which is rendered using AJAX)

markupWriter.be gin("a");
markupWriter.at tribute("name", this.getName() + "CalendarAnchor ");
markupWriter.at tribute("href", "javascript:voi d(0);");
markupWriter.at tribute("class" , "nonnav");
markupWriter.at tribute("onclic k", "showCalendar() ;");
markupWriter.cl oseTag();

showCalendar() function is defined in the same file.
May 29 '07 #3
msinghal
3 New Member
What is hapening on the refresh? You might have to show some code.
I have send u a code snipplet. Plz see if u can help me with it.....I am waiting for ur response.
May 29 '07 #4

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

Similar topics

0
1483
by: Beto | last post by:
I am working on a project and I was thinking about implement ajax instead of using pure asp.net, however I've got a problem. The page: the page is like a google, yahoo or any other search engine, but with a difference: when you click a link, instead of go to a page, a text will be added above the link, like expanding the page on the line above the link. The idea: The idea is populate a gridview where each row is a link. When the user
9
3227
by: monomaniac21 | last post by:
hi all i want to use hyperlinks to 'load' content by changing the display of div tags. the problem i have is that unless i specify a href the anchor does not change the mouse pointer on hover even if display is set to block. it only look changes when there is a href there. but if i have a href there then when i click it will load the page, which i dont want. how can i get the anchor to look like a proper link where the users pointer...
8
2496
by: -Karl | last post by:
Snippet: http://www.nomorepasting.com/getpaste.php?pasteid=1020&seen=true&numbered=on&langoverride=asp Line 37 is where I am having the problem. I can't get the onclick event to fire off. Yet line 16 works like it's supposed to. How do I get my onclick event to work? I tried changing it from onclick to onserverclick but that had no effect. Thanks!
8
3311
by: henryrhenryr | last post by:
I'm trying to log all links clicked. I'm just working this out so there may be some astoundingly bad methods. Please point out! It all works nicely though if I use mouseover events as the trigger. If I use click events then the AJAX bit breaks. Here's the code (mostly): Adding event listener to all links (firefox tells me errors but it works?!). When I switch from mouseover to click, the whole thing breaks down. function...
6
2176
by: Nathan Sokalski | last post by:
I have a DataList which contains several LinkButtons, which are used to select a category in my application. I want the currently selected category to use a different CSS class. Here is an example of the generated code for one of the buttons: <a onclick="UnselectCategories();datCategories_ctl00_lnkCategory.className='Category_Selected';" id="datCategories_ctl00_lnkCategory" class="Category_Selected"...
4
3675
by: donpro | last post by:
Hi, I've created a table where the header columns link to an AJAX function which calls a PHP file and returns content - the purpose is to sort the table on the heading. The code snippet is: <th scope="col"><a href="javascript:;" onclick="loadBookingContent('<? php echo $SERVERPAGE_URL . SORT_BY_BOOKING; ?>','innerhbl')">Booking</ a></th>
4
1487
by: Big Moxy | last post by:
test page - http://projects.missioninternet.com/proweb/clients/test.php. When I added the onclick event so that I could employ ajax on this page the stylesheet formatting for this <lidisappeared. If you look at the test page you can see what it should look like. The stylesheet also defines a:hover behavior (change the font-weight to bold). <li onclick="makeRequest('echo.php?clientID=<?php echo $clientID; ? Q1: What happened?
1
3969
by: ramel | last post by:
Hi all, I have a problem related to javascript , ajax and jsp. Please see this url http://xil.co.in/print_screen_2.JPG. I am working on this form. There are some buttons (like submit , add ,edit at bottom of this page , but not visible in printscreen). On click of a radio button on left side , form fields on right side and small table on right bottom is gettig populated. The table on right bottom , is actually the eligibility...
18
3943
by: navyjax2 | last post by:
What if your event handler has to be nonstatic?
0
8888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9113
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6702
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.