Magento 2.3.1 not allowing javascript codeLocal installation of Magento 2 doest not generate files in the pub/static folderMagento 2 CSS and JavaScript not loading from correct folderOwl Carousel Magento 2 not Fully ResponsiveMagento 2 : Symbolic links to pub/static filesCustomising the Magento 2 main navigation (topmenu) javaScriptRelease Management in Magento 2How does Magento determine the route / getting 404 behind proxyMagento 2 CMS 404 errorMagento 2.3: How to solve the message “Unable to send email”?Column not found: 1054 Unknown column 'search_result.score' in 'order clause'

Generate basis elements of the Steenrod algebra

60s or 70s novel about Empire of Man making 1st contact with 1st discovered alien race

What is the meaning of the Russian idiom "to taste tuna" ("отведать тунца")?

Advantages of the Exponential Family: why should we study it and use it?

How to “listen” to existing circuit

Why not invest in precious metals?

Why can I traceroute to this IP address, but not ping?

What aircraft was used as Air Force One for the flight between Southampton and Shannon?

Live action TV show where High school Kids go into the virtual world and have to clear levels

Which is the better way to call a method that is only available to one class that implements an interface but not the other one?

Can I utilise a baking stone to make crepes?

Next date with distinct digits

I have a problematic assistant manager, but I can't fire him

How can I end combat quickly when the outcome is inevitable?

Smart-expansion of a range to a list of numbers

Is an entry level DSLR going to shoot nice portrait pictures?

If there's something that implicates the president why is there then a national security issue? (John Dowd)

Excel division by 0 error when trying to average results of formulas

Solve Riddle With Algebra

Why can my keyboard only digest 6 keypresses at a time?

How to make insert mode mapping count as multiple undos?

Should I refuse being named as co-author of a bad quality paper?

How to communicate to my GM that not being allowed to use stealth isn't fun for me?

Bb13b9 confusion



Magento 2.3.1 not allowing javascript code


Local installation of Magento 2 doest not generate files in the pub/static folderMagento 2 CSS and JavaScript not loading from correct folderOwl Carousel Magento 2 not Fully ResponsiveMagento 2 : Symbolic links to pub/static filesCustomising the Magento 2 main navigation (topmenu) javaScriptRelease Management in Magento 2How does Magento determine the route / getting 404 behind proxyMagento 2 CMS 404 errorMagento 2.3: How to solve the message “Unable to send email”?Column not found: 1054 Unknown column 'search_result.score' in 'order clause'






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am setting up my store on latest Magento 2.3.1 CE edition.
Apache version: Apache/2.4.39
PHP version: 7.2.18
MySQL version: 10.1.40-MariaDB.



Also I am using Porto theme.



There is a strange problem I am facing for first time. In static block, if I use some JavaScript code like below or any other custom code



<script>document.write(new Date().getFullYear())</script>


Static Block Code
and when I save it, I get error




404 error: Page not found.




404 error after saving static block



If I remove JavaScript code, and put simple text in para html tag, it gets saved successfully. I have used previous versions of Magento 2 and porto theme earlier also but never got such an error. Using Magento 2.3.1 for first time.



Is there any setting in this version of Magento to explicitly allow usage of JavaScript in static blocks?










share|improve this question
























  • have you tried using <script type="text/javascript"> opening script tag instead of plain script tag

    – fmsthird
    Jun 3 at 7:27











  • @magefms . Yes, I tried that too. But still get same 404 error. Updated my question with snapshots. Just FYI, I run following commands to deploy theme. php -d memory_limit=-1 bin/magento setup:upgrade ; php -d memory_limit=-1 -d display_errors=on bin/magento setup:static-content:deploy -s standard -vvv -f ; Do I also need to run compile command to deploy theme ?

    – Devanshu
    Jun 3 at 15:14


















0















I am setting up my store on latest Magento 2.3.1 CE edition.
Apache version: Apache/2.4.39
PHP version: 7.2.18
MySQL version: 10.1.40-MariaDB.



Also I am using Porto theme.



There is a strange problem I am facing for first time. In static block, if I use some JavaScript code like below or any other custom code



<script>document.write(new Date().getFullYear())</script>


Static Block Code
and when I save it, I get error




404 error: Page not found.




404 error after saving static block



If I remove JavaScript code, and put simple text in para html tag, it gets saved successfully. I have used previous versions of Magento 2 and porto theme earlier also but never got such an error. Using Magento 2.3.1 for first time.



Is there any setting in this version of Magento to explicitly allow usage of JavaScript in static blocks?










share|improve this question
























  • have you tried using <script type="text/javascript"> opening script tag instead of plain script tag

    – fmsthird
    Jun 3 at 7:27











  • @magefms . Yes, I tried that too. But still get same 404 error. Updated my question with snapshots. Just FYI, I run following commands to deploy theme. php -d memory_limit=-1 bin/magento setup:upgrade ; php -d memory_limit=-1 -d display_errors=on bin/magento setup:static-content:deploy -s standard -vvv -f ; Do I also need to run compile command to deploy theme ?

    – Devanshu
    Jun 3 at 15:14














0












0








0








I am setting up my store on latest Magento 2.3.1 CE edition.
Apache version: Apache/2.4.39
PHP version: 7.2.18
MySQL version: 10.1.40-MariaDB.



Also I am using Porto theme.



There is a strange problem I am facing for first time. In static block, if I use some JavaScript code like below or any other custom code



<script>document.write(new Date().getFullYear())</script>


Static Block Code
and when I save it, I get error




404 error: Page not found.




404 error after saving static block



If I remove JavaScript code, and put simple text in para html tag, it gets saved successfully. I have used previous versions of Magento 2 and porto theme earlier also but never got such an error. Using Magento 2.3.1 for first time.



Is there any setting in this version of Magento to explicitly allow usage of JavaScript in static blocks?










share|improve this question
















I am setting up my store on latest Magento 2.3.1 CE edition.
Apache version: Apache/2.4.39
PHP version: 7.2.18
MySQL version: 10.1.40-MariaDB.



Also I am using Porto theme.



There is a strange problem I am facing for first time. In static block, if I use some JavaScript code like below or any other custom code



<script>document.write(new Date().getFullYear())</script>


Static Block Code
and when I save it, I get error




404 error: Page not found.




404 error after saving static block



If I remove JavaScript code, and put simple text in para html tag, it gets saved successfully. I have used previous versions of Magento 2 and porto theme earlier also but never got such an error. Using Magento 2.3.1 for first time.



Is there any setting in this version of Magento to explicitly allow usage of JavaScript in static blocks?







magento2 javascript 404-page http-error-404






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 3 at 15:13







Devanshu

















asked Jun 2 at 15:22









DevanshuDevanshu

62




62












  • have you tried using <script type="text/javascript"> opening script tag instead of plain script tag

    – fmsthird
    Jun 3 at 7:27











  • @magefms . Yes, I tried that too. But still get same 404 error. Updated my question with snapshots. Just FYI, I run following commands to deploy theme. php -d memory_limit=-1 bin/magento setup:upgrade ; php -d memory_limit=-1 -d display_errors=on bin/magento setup:static-content:deploy -s standard -vvv -f ; Do I also need to run compile command to deploy theme ?

    – Devanshu
    Jun 3 at 15:14


















  • have you tried using <script type="text/javascript"> opening script tag instead of plain script tag

    – fmsthird
    Jun 3 at 7:27











  • @magefms . Yes, I tried that too. But still get same 404 error. Updated my question with snapshots. Just FYI, I run following commands to deploy theme. php -d memory_limit=-1 bin/magento setup:upgrade ; php -d memory_limit=-1 -d display_errors=on bin/magento setup:static-content:deploy -s standard -vvv -f ; Do I also need to run compile command to deploy theme ?

    – Devanshu
    Jun 3 at 15:14

















have you tried using <script type="text/javascript"> opening script tag instead of plain script tag

– fmsthird
Jun 3 at 7:27





have you tried using <script type="text/javascript"> opening script tag instead of plain script tag

– fmsthird
Jun 3 at 7:27













@magefms . Yes, I tried that too. But still get same 404 error. Updated my question with snapshots. Just FYI, I run following commands to deploy theme. php -d memory_limit=-1 bin/magento setup:upgrade ; php -d memory_limit=-1 -d display_errors=on bin/magento setup:static-content:deploy -s standard -vvv -f ; Do I also need to run compile command to deploy theme ?

– Devanshu
Jun 3 at 15:14






@magefms . Yes, I tried that too. But still get same 404 error. Updated my question with snapshots. Just FYI, I run following commands to deploy theme. php -d memory_limit=-1 bin/magento setup:upgrade ; php -d memory_limit=-1 -d display_errors=on bin/magento setup:static-content:deploy -s standard -vvv -f ; Do I also need to run compile command to deploy theme ?

– Devanshu
Jun 3 at 15:14











0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f277003%2fmagento-2-3-1-not-allowing-javascript-code%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f277003%2fmagento-2-3-1-not-allowing-javascript-code%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form