browserstate / ajaxify

Ajaxify your entire website instantly with this simple drop-in script using the HTML5 History API with History.js and jQuery ScrollTo.
602 stars 94 forks source link

Ajaxify cut tags in inline javascript #30

Open Satariall opened 10 years ago

Satariall commented 10 years ago

I have some pages. They generated inline javascript code from php. For example:

<script>
var someArray = Array();
<?foreach($videos as $num=>$code):?>
 someArray['<?=$num?>'] = '<?=$code?>';
<?endforeach;?>
</script>

$code = iframe html's from youtube (as example). Actualy they may contain anything as <div><span>text</span></div>

So when page load directly - all work as well. But when this page load from ajaxify inline script cut all tags in inline javascript.

What i can do for fix them? I see in ajaxify code watch for all open and closed tags, which cut and paste in document-html element and paste to result page. I want to cut inline js first and before that parse html tags. So, i think first stage is cut all around .content element, them parse inline js and after that work with other tags.

Any idea? (sry for bad english). Thanks