You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this parser in the gatsby project, where I get article content in the HTML string format and I sanitize it using the parse method. In my case, I have shown polldaddy (survey) embedded code.
From issue #98, I came to know to execute the script need to use the replace function, which I did for polldaddy, I have replaced the same script using the replace function, which is even getting called in the network (local and staging development) but couldn't able to load render its HTML which gets generated from the replaced script under #pollDaddyInfo div.
But if I called the same script outside gatsby/react env or in js env then it's working perfectly, Here is jsbin demo
Can you please explain if this issue or rehydration or why this is happening or what approach I should follow to resolve this issue?
The text was updated successfully, but these errors were encountered:
yashvekaria
changed the title
Dynamic html is not able to generated from the embedded script under specific element even after it gets replaced and execute.
Dynamic html is not able to generated from the embedded script under specific element even after it gets replaced and executed.
Nov 26, 2021
I exactly understood the problem lies behind this question, actually, the polldaddy 3rd party script is creating its HTML using document.write() method which creates error as its script is being dynamically added, which does not encourage document.write method. here's is the StackOverflow link
Found this article google article suggesting not use document.write() method for 3rd party scripts
Hi,
I am using this parser in the gatsby project, where I get article content in the HTML string format and I sanitize it using the
parse
method. In my case, I have shown polldaddy (survey) embedded code.From issue #98, I came to know to execute the script need to use the
replace
function, which I did for polldaddy, I have replaced the same script using thereplace
function, which is even getting called in the network (local and staging development) but couldn't able to load render its HTML which gets generated from the replaced script under #pollDaddyInfo div.I have created a demo in codesandbox
But if I called the same script outside gatsby/react env or in js env then it's working perfectly, Here is jsbin demo
Can you please explain if this issue or rehydration or why this is happening or what approach I should follow to resolve this issue?
The text was updated successfully, but these errors were encountered: