javascript - Undefined error when embedding SVG -
i' using ajax
call retrieve htm
file builds svg
. call returns file area it's suppose appear says:
is timing issue? have ajax call in separate js
file called after page loads.
function buildmap(){ var lbmp = document.getelementbyid("lbmp-map"); if(lbmp != null){ $.ajax({ url:'../footer.htm', method: 'get', success: function(response){ lbmp.innerhtml = response.responsetext; }, failure: function(response){ lbmp.innerhtml = "<p>failure</p>"; } }); } }
on success, ajax gives directly content, html in response
, not in response.responsetext
, that's why getting undefined
message.
Comments
Post a Comment