Created
September 28, 2011 11:01
-
-
Save polymorphm/1247654 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js"></script>--> | |
<script> | |
//<![CDATA[ | |
(function ($) { | |
'use strict' | |
var content = $( | |
'<div>' + | |
'<h1>это мой новый супер контент</h1>' + | |
'<p>я его долго холил и лелеел</p>' + | |
'<p>даже есть одна <span class="TheButtonStub"></span> :-)...</p>' + | |
'<\/div>' | |
) | |
var the_button = $('<a href="#">Кнопочка<\/a>') | |
the_button.click(function (event) { | |
event.preventDefault() | |
alert('вот вы и нажали на эту кнопочку! :-D') | |
}) | |
content.find('.TheButtonStub').replaceWith(the_button) | |
$(function () { | |
$('.Page').empty() | |
$('.Page').append(content) | |
}) | |
})(jQuery) | |
//]]> | |
</script> | |
<div class="Page">Loading...</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment