falsandtru / pjax-api

The advanced PJAX superior to SPA.
https://falsandtru.github.io/pjax-api/
Apache License 2.0
318 stars 28 forks source link

inline javascript not called #29

Closed CyberKoo closed 7 years ago

CyberKoo commented 7 years ago

Hi, I just discovered pjax not execute the inline script when i'm using safari, but other browser works fine.

Safari version 10.1.2 (12603.3.8)

falsandtru commented 7 years ago

The reason is Safari doesn't evaluate a script by dom injection.

https://github.com/falsandtru/pjax-api/blob/bad289372c8fd9aaa397b256975151ddb44a573b/src/layer/domain/router/module/update/script.ts#L124

However if I use eval function instead, document.currentScript support will be removed. Any ideas?

falsandtru commented 7 years ago

Fixed.