Created
April 21, 2012 23:41
-
-
Save fedmich/2440296 to your computer and use it in GitHub Desktop.
Stack overflow answers
This file contains 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
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var obj_h2 = $('h2'); | |
var h2_title = obj_h2.html(); | |
var words = h2_title.split(' '); | |
words[0] = '<span>' + words[0] + '</span>' | |
obj_h2.html( words.join( ' ' ) ); | |
}); | |
</script> | |
<style type="text/css"> | |
h2 span{ | |
color:red; | |
} | |
</style> | |
</head> | |
<body> | |
<h2>Converted post title</h2> | |
</body> | |
</html> |
This file contains 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
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$('h2.title').each( function (){ | |
var obj_h2 = $(this); | |
var h2_title = obj_h2.html(); | |
var words = h2_title.split(' '); | |
words[0] = '<span>' + words[0] + '</span>' | |
obj_h2.html( words.join( ' ' ) ); | |
} ); | |
}); | |
</script> | |
<style type="text/css"> | |
h2.title span{ | |
color:red; | |
} | |
</style> | |
</head> | |
<body> | |
<h2 class="title">Converted post title</h2> | |
<h2 class="title">Title #2</h2> | |
<h2 class="title">This is H3 #3</h2> | |
</body> | |
</html> |
This file contains 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
RedirectMatch 301 ^/(site1|site2|category1)(/.*|$) /$1-new$2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment