javascript - Remove part of filename with jQuery -


I want to strip a file name like this: IMG_6903.JPG and width = 504

:

IMG_6903.JPG

...

My script looks like this:

 $ (Function () ($ ('$ Exposure IMG'). Each (function () {var $ imgSrc = this.src.split ('& amp;'); $ (this). Wrap ('& Attr ("href", "" + $ imgSrc);}}}});   

but the word " It does not work ... How do I do this?

  var imgSrc = this.src .substring (0, this.src.indexOf ('& amp;'));    

Comments