PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, December 20, 2022

[FIXED] Where is the syntax error located in this JavaScript code?

 December 20, 2022     javascript, syntax     No comments   

Issue

I have a syntax problem somewhere but can't spot it as I am not a javascript developer. Can someone with a better eye point out the problem?

$.ajax(
    {
        type: 'GET',
        url: / + 'modules/blocklayered/blocklayered-ajax-back.php',

Uncaught SyntaxError: Unexpected token ILLEGAL

        data: (all ? '' : $('input[name="categoryBox[]"]').serialize()+'&')+(id_layered_filter ? 'id_layered_filter='+parseInt(id_layered_filter)+'' : ''),
        success: function(result) {

Solution

The syntax error is on this line...

url: / +     'modules/blocklayered/blocklayered-ajax-back.php',

The / is misplaced, and should be...

url: '/modules/blocklayered/blocklayered-ajax-back.php',


Answered By - freefaller
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing