Skip to content

Instantly share code, notes, and snippets.

@polymorphm
Created September 28, 2011 11:01
Show Gist options
  • Save polymorphm/1247654 to your computer and use it in GitHub Desktop.
Save polymorphm/1247654 to your computer and use it in GitHub Desktop.
<!--<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