-2

My string is like this

sakjgbsd aksdg's ad asidg's iasudgbsb

but when i print the string in function it prints only

 sakjgbsd aksdg

the part after (') is not printing

here is how i send data

<a href='#' data-status='" + data[i][col[j]] + "' " +
                            "onclick='submit(this)'>Click Here</a>

here is Function

function submit(str) 
{
var status = $(str).attr("data-status");
alert(status)
}
2
  • the part after (') is not printing ' show closing/ending of string. Commented Mar 19, 2019 at 8:37
  • why should it throw error? Commented Mar 19, 2019 at 8:52

1 Answer 1

1

Change your string to

`sakjgbsd aksdg's ad asidg's iasudgbsb` // backticks (sign under tilde ~)

or

"sakjgbsd aksdg's ad asidg's iasudgbsb"
Sign up to request clarification or add additional context in comments.

2 Comments

In English, it's tilde.
That's not an error BTW. That's just a different language.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.