1

I am need to use trip advisor widget in my website. It works fine when the page is refreshed. But when navigated through links the widget doesn't show up. Also it gives an error saying that the document couldn't write since the element with id is not found.

I think the problem is because the script looks for the element with the specified id even before the page renders. The below one doesn't work for me.

Including tripadvisor widget in angularjs app

Is there a better solution?

Community
  • 1
  • 1
prdtuty
  • 532
  • 3
  • 9
  • 21

1 Answers1

0

The issue is that in the URL from that linked question the ampersands are are encoded.

http://www.jscache.com/wejs?wtype=cdsratingsonlynarrow&uniq=791&locationId=2227230&lang=en_US&border=true

should be-

http://www.jscache.com/wejs?wtype=cdsratingsonlynarrow&uniq=791&locationId=2227230&lang=en_US&border=true

That should fix it.

micah
  • 7,596
  • 10
  • 49
  • 90
  • Nope. Still gives the same error. "Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened." – prdtuty Sep 02 '15 at 15:19
  • I see. Replace the src of your ` – micah Sep 02 '15 at 15:22