Magento2: How to add script .js to blockHow to add addition script to existing validation classCan't add jquery scriptMagento 2 add script before closing body tagMagento2 - Backend layout seems brokenCMS Read More scriptMagento 2 custom Admin controller redirect to DashboardTable create script not working Magento2how to call script from block argument?Magento 2.2.5: How to validate shipping addressInvalid Return Type in Ajax Call
UK Tourist Visa- Enquiry
Asserting that Atheism and Theism are both faith based positions
When should a starting writer get his own webpage?
How old is Nick Fury?
Air travel with refrigerated insulin
Help with identifying unique aircraft over NE Pennsylvania
Friend wants my recommendation but I don't want to give it to him
Why doesn't the fusion process of the sun speed up?
How to understand 「僕は誰より彼女が好きなんだ。」
Gauss brackets with double vertical lines
Turning a hard to access nut?
"Marked down as someone wanting to sell shares." What does that mean?
How are passwords stolen from companies if they only store hashes?
Hot air balloons as primitive bombers
How to test the sharpness of a knife?
Is VPN a layer 3 concept?
What are the consequences of changing the number of hours in a day?
Homology of the fiber
How can a new country break out from a developed country without war?
is this saw blade faulty?
Imaginary part of expression too difficult to calculate
Does convergence of polynomials imply that of its coefficients?
Print last inputted byte
The English Debate
Magento2: How to add script .js to block
How to add addition script to existing validation classCan't add jquery scriptMagento 2 add script before closing body tagMagento2 - Backend layout seems brokenCMS Read More scriptMagento 2 custom Admin controller redirect to DashboardTable create script not working Magento2how to call script from block argument?Magento 2.2.5: How to validate shipping addressInvalid Return Type in Ajax Call
I want add script with reviews to custom_block in magento 2.
<span id="__ceneo-reviews-5404f405-e31c-4e74-9b51-0ebeee8bcd2d"></span>
<br/>
<small>
<a href="https://www.ceneo.pl/26306-0a" rel="nofollow" target="_blank">» przeczytaj wszystkie opinie</a>
</small>
<script>
(function (d,t)
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src('https:'==document.location.protocol?'https://':'http://')+'ssl.ceneo.pl/shops/rw.js?accountGuid=5404f405-e31c-4e74-9b51-0ebeee8bcd2d';
s.async=true;
s.parentNode.insertBefore(g, s);
(document,'script'));
</script>
after save, I see only this content in html.
Looks .js do not work here. Any solution?
magento2 javascript
add a comment |
I want add script with reviews to custom_block in magento 2.
<span id="__ceneo-reviews-5404f405-e31c-4e74-9b51-0ebeee8bcd2d"></span>
<br/>
<small>
<a href="https://www.ceneo.pl/26306-0a" rel="nofollow" target="_blank">» przeczytaj wszystkie opinie</a>
</small>
<script>
(function (d,t)
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src('https:'==document.location.protocol?'https://':'http://')+'ssl.ceneo.pl/shops/rw.js?accountGuid=5404f405-e31c-4e74-9b51-0ebeee8bcd2d';
s.async=true;
s.parentNode.insertBefore(g, s);
(document,'script'));
</script>
after save, I see only this content in html.
Looks .js do not work here. Any solution?
magento2 javascript
add a comment |
I want add script with reviews to custom_block in magento 2.
<span id="__ceneo-reviews-5404f405-e31c-4e74-9b51-0ebeee8bcd2d"></span>
<br/>
<small>
<a href="https://www.ceneo.pl/26306-0a" rel="nofollow" target="_blank">» przeczytaj wszystkie opinie</a>
</small>
<script>
(function (d,t)
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src('https:'==document.location.protocol?'https://':'http://')+'ssl.ceneo.pl/shops/rw.js?accountGuid=5404f405-e31c-4e74-9b51-0ebeee8bcd2d';
s.async=true;
s.parentNode.insertBefore(g, s);
(document,'script'));
</script>
after save, I see only this content in html.
Looks .js do not work here. Any solution?
magento2 javascript
I want add script with reviews to custom_block in magento 2.
<span id="__ceneo-reviews-5404f405-e31c-4e74-9b51-0ebeee8bcd2d"></span>
<br/>
<small>
<a href="https://www.ceneo.pl/26306-0a" rel="nofollow" target="_blank">» przeczytaj wszystkie opinie</a>
</small>
<script>
(function (d,t)
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src('https:'==document.location.protocol?'https://':'http://')+'ssl.ceneo.pl/shops/rw.js?accountGuid=5404f405-e31c-4e74-9b51-0ebeee8bcd2d';
s.async=true;
s.parentNode.insertBefore(g, s);
(document,'script'));
</script>
after save, I see only this content in html.
Looks .js do not work here. Any solution?
magento2 javascript
magento2 javascript
edited 14 hours ago
Gee Emm
1299
1299
asked 15 hours ago
SylvesterSylvester
735216
735216
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I hope, you may call that block in your custom phtml file right If so you can keep html element in cms block and keep JS snippet in your custom phtml file.
Something like below way,
<script type="text/javascript" xml="space">
(function (d,t)var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src=('https:'==document.location.protocol?'https://':'http://')+'ssl.ceneo.pl/shops/rw.js?accountGuid=5404f405-e31c-4e74-9b51-0ebeee8bcd2d';s.async=true;s.parentNode.insertBefore(g, s);(document,'script'));
</script>
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266387%2fmagento2-how-to-add-script-js-to-block%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I hope, you may call that block in your custom phtml file right If so you can keep html element in cms block and keep JS snippet in your custom phtml file.
Something like below way,
<script type="text/javascript" xml="space">
(function (d,t)var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src=('https:'==document.location.protocol?'https://':'http://')+'ssl.ceneo.pl/shops/rw.js?accountGuid=5404f405-e31c-4e74-9b51-0ebeee8bcd2d';s.async=true;s.parentNode.insertBefore(g, s);(document,'script'));
</script>
add a comment |
I hope, you may call that block in your custom phtml file right If so you can keep html element in cms block and keep JS snippet in your custom phtml file.
Something like below way,
<script type="text/javascript" xml="space">
(function (d,t)var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src=('https:'==document.location.protocol?'https://':'http://')+'ssl.ceneo.pl/shops/rw.js?accountGuid=5404f405-e31c-4e74-9b51-0ebeee8bcd2d';s.async=true;s.parentNode.insertBefore(g, s);(document,'script'));
</script>
add a comment |
I hope, you may call that block in your custom phtml file right If so you can keep html element in cms block and keep JS snippet in your custom phtml file.
Something like below way,
<script type="text/javascript" xml="space">
(function (d,t)var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src=('https:'==document.location.protocol?'https://':'http://')+'ssl.ceneo.pl/shops/rw.js?accountGuid=5404f405-e31c-4e74-9b51-0ebeee8bcd2d';s.async=true;s.parentNode.insertBefore(g, s);(document,'script'));
</script>
I hope, you may call that block in your custom phtml file right If so you can keep html element in cms block and keep JS snippet in your custom phtml file.
Something like below way,
<script type="text/javascript" xml="space">
(function (d,t)var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src=('https:'==document.location.protocol?'https://':'http://')+'ssl.ceneo.pl/shops/rw.js?accountGuid=5404f405-e31c-4e74-9b51-0ebeee8bcd2d';s.async=true;s.parentNode.insertBefore(g, s);(document,'script'));
</script>
answered 14 hours ago
ThamoThamo
312
312
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266387%2fmagento2-how-to-add-script-js-to-block%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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