Question

I am migrating to jQuery 1.9.1, and use the JQMigrate tool mentioned in the release notes.

I receive the following warning:

JQMIGRATE: $(html) HTML strings must start with '<' character

The explanation by the jQuery folks is quite clear, but how to find the offending line?

The problem seems to be hidden somewhere in a 3rd party lib (mediaelementjs) or in the usage of it. I found this by commenting out calls. But there is quite much going on and I am stuck.


UPDATE: With the help of Kevin B I found the offending line, it was indeed within mediaelementJS. I the mediaelement-and-player.js it was line #3176 which was (note the outer whitespaces)

timeAndDurationSeparator: ' <span> | </span> '

and is now

timeAndDurationSeparator: '<span> | </span>'

which works flawlessly now.

In case anyone runs into the same issue, here is the modified file:

I will notify the original author, John Dyer about this.

Was it helpful?

Solution

Look at the right side of your console, under the stack trace. The one line that doesn't say jQuery Migrate or jquery.js is probably the offending line.

For example, on this fiddle, the offending line is line 24, listed as (anonymous function)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top