0

Error: invalid regular expression flag b Source File: http://localhost/media/javascript/global.js Line: 4, Column: 19 Source Code: url: /home/blog,

$("#blog").click(function () {
var url = $(this).attr("href");
$.ajax ({
    url: /home/blog,
    type: "POST",
    success : function (html) {
        $("#someDiv").append(html);
    }
});

});

I cant figure out what the error is, does my URL need to be in a string? What am I missing?

3 Answers 3

2

You want the url to be "home/blog"

Sign up to request clarification or add additional context in comments.

Comments

0

Im not a Javascript Guru, but from that sample, I would of thought that you need to put the URL in quotes, so it should read:

url: "/home/blog",

Comments

0

You haven't put your url in quotes.

url: "home/blog",

When you're looking at the errors returned, make note of the column and line numbers - they can really help and give a massive indication to where you may have gone wrong.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.