javascript - Php script loading with some html -


i have created html page (index.html) script loading of php page (page.php) :

    var dslscript  = document.createelement("script");     dslscript.src  = surl;     dslscript.type = "text/javascript";     document.body.appendchild(dslscript);     document.body.removechild(dslscript); 

my problem here php page contains html , javascript. html of page.php seems pose problem when index.html page tries load php page:

uncaught syntaxerror: unexpected token <

is there header can place on php page allow index.html process php code of page.php? or should convert html javascript/dom, may take time.

your script trying put html inside of tag. cause parse error. browser try evaluate inside tag javascript. so, yes, should convert inline html string fragments dynamically appended or inserted dom.


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -