jquery - Javascript sometimes fails to show text in paragraphs until some javascript event is called -



jquery - Javascript sometimes fails to show text in paragraphs until some javascript event is called -

i'm working on big opengl tutorial site , big part of content beingness retrieved via javascript. however, time time, loading site results in weird javascript behavior, haven't been able prepare myself. i'm not sure 'll able reproduce instantly since occurence seems bit non-deterministic site's url http://www.learnopengl.com.

if open plenty you'll bugged page i'm experiencing. content loaded, reason fails display text not enclosed within <code>, <em>, <strong> etc. tag (inline elements), still displays content within <code></code> tags example, fails display text within paragraphs.

it seems issue occurs when using chrome. i'm not able reproduce behavior using firefox and/or net explorer. using chrome used developer tools check if of html different, still same. there no javascript errors study in console. behavior unusual since seems occur @ random times.

also, whenever behavior occurs, start using uses javascript, content restores again. example, when clicking 1 of menu buttons left, or hovering on content activates javascript hover event.

i'll post header code here in case might of value:

<html> <head> <title>learn opengl . com, tutorial resource learning modern opengl</title> <script> // google analytics code ... </script> <script src="js/jquery-1.11.0.min.js"></script> <script src="js/hoverintent.js"></script> <link rel="stylesheet" type="text/css" href="layout.css"> <link rel="stylesheet" type="text/css" href="js/styles/obsidian.css"> <script src="js/highlight.pack.js"></script> <script src="js/functions.js"></script> <script type="text/javascript" src="js/mathjax/mathjax.js?config=tex-ams_html"></script> <script>hljs.inithighlightingonload();</script> <script> // onpopstate works in chrome when loading page, has done manually first time. $(document).ready(function() { loadpage(); }); var initialized = false; window.onpopstate = function() { if(initialized) loadpage(); else initialized = true; }; // set disqus var disqus_shortname = 'learnopengl'; (function() { var dsq = document.createelement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getelementsbytagname('head')[0] || document.getelementsbytagname('body')[0]).appendchild(dsq); })(); </script> </head>

and loadpage() function:

function loadpage() { if(window.location.hash) { var name = window.location.hash.substring(2); name = name.replace(/-/g," "); loadcontent(name, true, false); } else loadcontent("index", true, false); } function loadcontent(name, slide, changeurl) { var postdata = "content_name=" + name; $('#disqus_thread').hide(); $('#content').fadeout(slide? 250 : 0, function() { $.post("content_load.php", postdata, function(data) { $('#content').html(data); $('#content').fadein(slide ? 250 : 0); // check if info has been succesfully loaded, if so: alter title bar ajax hash fragment var title = $('#content-url').text(); if(title.indexof('404') == -1) { if(name != 'index') document.title = $('#content-title').text(); title = title.replace(/ /g,"-"); if(changeurl) { var link = '/'; if(name != "index") link = "#!" + title; history.pushstate({}, '', link); } // refresh syntax highlighting $('pre').each(function(i, e) {hljs.highlightblock(e)}); mathjax.hub.queue(["typeset",mathjax.hub]); // reset disqus disqus.reset({ reload: true, config: function () { this.page.identifier = title; this.page.url = "http://www.learnopengl.com/" + title; } }); $('#disqus_thread').show(); // post processing functions follow ... } }); }); }

i'm @ loss , hoping of re-create behavior , see weird pop up.

javascript jquery html ajax

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -