為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

PHP script is not executing JavaScript code correctly in firefox

more options

Hello

I have a php script that should do the following echo '<script type="text/javascript">', 'cart.add("54");', '</script>'; echo '<script type="text/javascript">','location.href = "http://mysite.com/index.php?route=checkout/checkout";','</script>';

now the php page works fine in every browser and it used to work fine in previous firefox browsers. however i noticed that with the last two updates with the page is not working fine. it seems that firefox skip the execution of cart.add(54) or it does not wait till it finished and then it goes on redirecting.

i dont know why with the recent updates this code stopped working ! any suggestions would be appreciated

Hello I have a php script that should do the following echo '<script type="text/javascript">', 'cart.add("54");', '</script>'; echo '<script type="text/javascript">','location.href = "http://mysite.com/index.php?route=checkout/checkout";','</script>'; now the php page works fine in every browser and it used to work fine in previous firefox browsers. however i noticed that with the last two updates with the page is not working fine. it seems that firefox skip the execution of cart.add(54) or it does not wait till it finished and then it goes on redirecting. i dont know why with the recent updates this code stopped working ! any suggestions would be appreciated

所有回覆 (1)

more options

Hello ehab92.

The PHP script is being run on the webserver (mostly independent on the browser) to generate the HTML output. This HTML output can contain JavaScript and is what is rendered and eventually executed in the browser.

I am not a good PHP developer, so can you please paste here a link on this example page, or add here the HTML output, which does not work in Firefox as expected?

Michal