Hello....
I need to add a <script> tag that has a .js source. Also, I need to add a <script> block. And finally, I have to add an onload event to the <BODY> tag. All this, from the contact controller. How can I do it?
The final goal is to add a GoogleMap to the contact page.
Any help will be greatly appreciated.
Jaime
I need to add a <script> tag that has a .js source. Also, I need to add a <script> block. And finally, I have to add an onload event to the <BODY> tag. All this, from the contact controller. How can I do it?
The final goal is to add a GoogleMap to the contact page.
Any help will be greatly appreciated.
Jaime
You can use:
in the controller
Body onload is so 1999
There are better ways now
Using jquery (which already comes with opencart) you have
or just using normal js you can use:
Code: Select all
$this->document->addScript('catalog/view/javascript/xxxx.js');
Body onload is so 1999
There are better ways now
Using jquery (which already comes with opencart) you have
Code: Select all
$(document).ready(function () {
....Do js stuff here...
});
Code: Select all
window.onload = functionA;
Mabye not really on topic but could you tell me how to run the following from a information page?
Must be simple but i cannot find how to anywhere. Thanks
Code: Select all
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [{
"@type": "Question",
"name": "Wat zijn Akoya parels?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Akoya parels zijn ..... enz"
}
},{
"@type": "Question",
"name": "Waar komen Akoya parels vandaan?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Akoya parels komen voornamelijk uit Japan"
}
},{
"@type": "Question",
"name": "Hoe worden Akoya parels gekweekt?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Akoya parels worden gekweekt door"
}
},{
"@type": "Question",
"name": "",
"acceptedAnswer": {
"@type": "Answer",
"text": ""
}
}]
}
</script>
Hello Jansuh,
I suggest you to write JS in respective template file & send dynamic data in JS that will be more easier instead of creating a dynamic JS, as you know it is very difficult to handle a JS code.
Thanks.
Kind Regards:
I suggest you to write JS in respective template file & send dynamic data in JS that will be more easier instead of creating a dynamic JS, as you know it is very difficult to handle a JS code.
Thanks.
Kind Regards:
Call us at : (+91) -8765210318 , Skype: live:carlmorgan.cedcommerce , Email: support@cedcommerce.com
CedCommerece : Officail Opencart Partners
CedCommerce Official : www.cedcommerce.com
Opencart Services : www.cedcommerce/opencart-services.com
Sell On various Marketplace Integration : Opencart-Extensions
Magenative Mobile App/IOS Development : magenative.com
Webinar : Power up Your holiday season marketing with the Automation tool
Who is online
Users browsing this forum: No registered users and 47 guests