Uncaught SyntaxError: missing ) after argument list


#1

Hello,

I am getting this error message

Thanks in advance

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
Here is my code:


$(document).ready(function() 
{           $(&quot;a&quot;).each(function() 
{             var i = $(this).attr(&quot;href&quot;);            
 var n = i.replace(http://www.example.com, &quot;https://www.example.com&quot;);                               $(this).attr(&quot;href&quot;, function() {               return n             })           })         });       </script>

#2

i really recommend you to fix the indent(ion) of your code. With correct indent, such an issue as you are currently facing, is easier to find, given it involves {}:

$(document).ready(function() 
{  // no matching } 

and:

$(&quot;a&quot;).each(function() 
{ // no matching }

by fixing the indent, its easier to see where this closing curly brackets are missing


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.