0

I have gotten a javascript error when trying to remove an attribute of type required. 5 red dots have appeared behind the script which i am unsure what they mean.

enter image description here

How can i remove the attribute of required? What are those red dots?

Edit:


$("#FileUpload").change(function () {
   var fileName = $(this).val().replace("C:\fakepath\", ");
   $("#FileName").html(fileName);
   $("#HasNewFile").val("True");
   $('#selectVehicleMake').removeAttr('required');​​​​​
   $('#selectVehicleRange').removeAttr('required');​​​​​
   $('#selectVehicleModelCode').removeAttr('required');​​​​​
   $('#selectVehicleModel').removeAttr('required');​​​​​
   $("#btnMatch").click();
});
Pomster
  • 14,567
  • 55
  • 128
  • 204
  • Can you copy the actual code? This might also be an encoding issue. – Cerbrus May 14 '14 at 07:50
  • What editor are you using? – Felix May 14 '14 at 07:53
  • 1
    I've read somewhere that Chrome console shows non-printable chars with red dots. Is that screen-shot from Chrome? – Álvaro González May 14 '14 at 07:53
  • 1
    There are 5 non-printable characters behind your `.removeAttr('required')` lines. Place your cursor after the `;`, and press [Del] untill the next line moves in front of your cursor. Do that for each line and you should be fine. – Cerbrus May 14 '14 at 07:53
  • @ÁlvaroG.Vicario Yes that is a screen shot from chrome. – Pomster May 14 '14 at 07:54
  • An hexadecimal editor would help. – Álvaro González May 14 '14 at 07:55
  • @Cerbrus what is kbd? – Pomster May 14 '14 at 07:56
  • 1
    @ÁlvaroG.Vicario: Would be overkill, you mean. Just a simple text editor should do. Pomster: Another option would be to just delete those lines, and type them again, manually. is a "keyboard markup" html tag that doesn't seem to be supported in comments. I meant: Press the "delete" key on your keyboard. – Cerbrus May 14 '14 at 07:56
  • 1
    @Cerbrus I mean to find out what those chars are. If you don't care and just want to get rid of them, of course, any editor will do. – Álvaro González May 14 '14 at 07:57
  • @Cerbrus Pressing del behind the ; removed some of the dots not all of them, but just deleting those lines and retyping them has worked. Thanks so much guys. – Pomster May 14 '14 at 08:05
  • I experienced a similar issue (only at the end of the file). For me it was a conflict between Virtualbox's shared folders and nginx's default sendfile option. – Tarnay Kálmán Aug 04 '14 at 22:43

2 Answers2

0

I have had this in two occasions and found that in both it was because there were white spaces behind the code. Best fix i found is to cut that code and paste it into note pad, the make sure there are no white spaces behind the text. You can check this by clicking behind the text and clicking backspace.

Pomster
  • 14,567
  • 55
  • 128
  • 204
0

Copying code from some code - "fields" > like stackoverflows have a hidden char in the element.

After copying to VS:

enter image description here

When copied into Text Editor (i used brackets)

enter image description here

I've found that the dot appears while inspecting the copied element:

enter image description here

So it seems to stem from jquery's prettyprint. and this is what it is

Community
  • 1
  • 1
Pakk
  • 1,299
  • 2
  • 18
  • 36