import re
from lxml import etree
doc = \
"""
<body>
<img alt='fdsfsd' src='CONST text1 text2'/>
adasd
<img alt='sadsdd' src='CONST text3 text4'/>
adasdas
</body>
"""
tree = etree.fromstring(doc, parser=etree.HTMLParser())
for img in tree.xpath('//img[@src]'):
img.attrib['src'] = re.sub(r'\s+', '_', img.attrib['src'])
$("#themeChanger>li>a").on('click', function(){
var themeName = $(this).text();
$("#codeThemesLink").attr("href", "js/rainbow/themes/" + themeName + ".css");
$("#themeChanger").parent().first().find('a:first').html(themeName + ' <span class="caret"></span>');
return false; // <---- вот так
});
if ( $result->num_rows > 0 )
{
while($row = $result->fetch_assoc())
{
$myArray[] = $row;
}
echo json_encode($myArray);
}
Expires: time.Now().Add(24*time.Hour)
import "time"