[Skip to main content](#vessel-content)

#   checkout javascript error

##

- **[nicirvine](/forum/user/13862-nicirvine "View nicirvine's Profile")**
- [![nicirvine's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/13862-nicirvine "View nicirvine's Profile") Topic Author
- [ Offline](/forum/user/13862-nicirvine)

Less More

- Posts: 20
- Thank you received: 1
-
-

6 years 9 months ago [\#314584](#314584) by [nicirvine](/forum/user/13862-nicirvine "View nicirvine's Profile")  *[checkout javascript error](/forum/31-development/898976-checkout-javascript-error#314584 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.14 -- PHP version -- : 7.3.12 -- Browser(s) name and version -- : Firefox (latest at this time) -- Error-message(debug-mod must be tuned on) -- : SyntaxError: unexpected token: ':'  Hi,  While implementing our own CAPTCHA found a javascript problem. Try this: - make sure you are not legged in - add a product to the cart - beginning the checkout - on the page for the customer try registering without validating the CAPTCHA code - the form is submitted to the server and an error is returned - on return all the script codes on the page are executed again, which is great, but joomla has some json object used just as a datablock which generate errors when you try to assign it &quot;text/javascript&quot; type and the rest of the javascript code is stopped.  This are defined with the tag:  You can find an example of this loaded by: {joomlaroot}&#92;libraries&#92;src&#92;Document&#92;Renderer&#92;Html&#92;HeadRenderer.php on the line 250. Found the code generating this problem here: {joomlaroot}&#92;media&#92;com&#95;hikashop&#92;js&#92;hikashop.js on the line 305.  I suggest removing those scripts from the list of scripts to be reloaded on AJAX since they are defined already on the header of the page.")* was created by *[nicirvine](/forum/user/13862-nicirvine "View nicirvine's Profile")*

-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.9.14
-- PHP version -- : 7.3.12
-- Browser(s) name and version -- : Firefox (latest at this time)
-- Error-message(debug-mod must be tuned on) -- : SyntaxError: unexpected token: ':'

Hi,

While implementing our own CAPTCHA found a javascript problem.
Try this:
- make sure you are not legged in
- add a product to the cart
- beginning the checkout
- on the page for the customer try registering without validating the CAPTCHA code
- the form is submitted to the server and an error is returned
- on return all the script codes on the page are executed again, which is great, but joomla has some json object used just as a datablock which generate errors when you try to assign it "text/javascript" type and the rest of the javascript code is stopped.

This are defined with the tag: Code:

&lt;script type="application/json ...&gt;...&lt;/script&gt;

You can find an example of this loaded by:
{joomlaroot}\libraries\src\Document\Renderer\Html\HeadRenderer.php on the line 250.
Found the code generating this problem here:
{joomlaroot}\media\com_hikashop\js\hikashop.js on the line 305.

I suggest removing those scripts from the list of scripts to be reloaded on AJAX since they are defined already on the header of the page.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5ODk3Ni1jaGVja291dC1qYXZhc2NyaXB0LWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

6 years 9 months ago [\#314628](#314628) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[checkout javascript error](/forum/31-development/898976-checkout-javascript-error#314628 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.14 -- PHP version -- : 7.3.12 -- Browser(s) name and version -- : Firefox (latest at this time) -- Error-message(debug-mod must be tuned on) -- : SyntaxError: unexpected token: ':'  Hi,  While implementing our own CAPTCHA found a javascript problem. Try this: - make sure you are not legged in - add a product to the cart - beginning the checkout - on the page for the customer try registering without validating the CAPTCHA code - the form is submitted to the server and an error is returned - on return all the script codes on the page are executed again, which is great, but joomla has some json object used just as a datablock which generate errors when you try to assign it &quot;text/javascript&quot; type and the rest of the javascript code is stopped.  This are defined with the tag:  You can find an example of this loaded by: {joomlaroot}&#92;libraries&#92;src&#92;Document&#92;Renderer&#92;Html&#92;HeadRenderer.php on the line 250. Found the code generating this problem here: {joomlaroot}&#92;media&#92;com&#95;hikashop&#92;js&#92;hikashop.js on the line 305.  I suggest removing those scripts from the list of scripts to be reloaded on AJAX since they are defined already on the header of the page.")*

Hi,

Thank you for your feedback. We'll add a check for that with the next version of HikaShop.
You can add such code in the javascript updateElem function to avoid the issue for now: Code:

if(all.indexOf('type="application/json"') != -1) return '';

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5ODk3Ni1jaGVja291dC1qYXZhc2NyaXB0LWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.108 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
