AddThis button will not work inside AJAX, but will work normally

后端 未结 8 741
温柔的废话
温柔的废话 2021-02-04 17:47

Basically, this is what I\'m doing. User visits site, loads \"index.html\" Within index.html, it automatically loads, through AJAX, \"details.html\" into a DIV. I put an ADDTHIS

8条回答
  •  时光取名叫无心
    2021-02-04 17:55

    Is details.html a fully compliant page on it's own? HTML, BODY, HEAD tags, etc?

    If so, I think things can get kind screwy when you try to load it into another page. I would either change details.html to just include the barebones markup that you need - or - if you need it to still be individually accessible - you could use jQuery to strip out the needed bits after the ajax call and only inject that portion.

    Details.html

    
    
    
    
        
    The needy bits.......

    Index.html

    $("#targetDivID").load("detail.html #details");
    

提交回复
热议问题