Skip to main content

Search and Top Navigation

#4687 closed bug (notabug)

Opened July 15, 2009 02:53PM UTC

Closed July 20, 2009 11:44PM UTC

Last modified October 11, 2012 09:15PM UTC

Dynamic content without events?

Reported by: Paladin76 Owned by:
Priority: minor Milestone:
Component: ui.core Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

I have this code (very simplyfied):

my html file


<html>

<head>

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>

<script type="text/javascript" src="jquery-ui-1.7.2.custom.min.js"></script>

<link type="text/css" href="mytheme/jquery-ui-1.7.2.custom.css" rel="stylesheet" />

<script type="text/javascript" src="myJQuery.js"></script>

</head>

<body>

<div id="mydiv">

</div>

</body>

</html>


my "myJQuery.js" file


$(document).ready(function()

{

// Add some dynamic content here

$('div#mydiv').html('<a href="#" id="myLink">Click me!</a>');

// Try to make some event with it...

$('a#mylink').click(function()

{

console.log('Hello World...');

});

};


So, this does not work, it will show up the link 'click me!', but nothing happends, when i click on it (i mean, no entry in my javascript console will be made). I use firefox, chrome, ie, opera, iron, safari, netscape 7, seamonkey, and some more Browsers to test, but it will not work.

The inclusions are all correct, firebug does not make a hint for missing files, and no error appear, but even nothing happens...

Please help...

Attachments (0)
Change History (2)

Changed July 20, 2009 11:44PM UTC by scottgonzalez comment:1

resolution: → invalid
status: newclosed

Ids are case sensitive, you need to use '#myLink' not '#mylink'.

Closing invalid; this has nothing to do with jQuery UI.

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:2

milestone: TBD

Milestone TBD deleted