开发者

jquery attribute getter breaks my webkitdotnet

I use a webkit dot net browser through c#, and I have a website that I am showing through that browser in a desktop application. Anyway, I came to a conclusion (tested line by line) the this line "breaks" my program (that is, nothing is displayed):

var class = $(this).attr("class");  

The thing is that the same co开发者_运维百科de is working fine in the newest Google Chrome browser so it has to be due to the webkitdotnet. Now, I'm asking if someone had a similar problem (and how he/she solved it), any help is welcome.

My second question (not sure if I should post it as sepparate question? - if so please tell me and I will): Is it possible to somehow "copy" the files from Chrome instalation to webkitdotnet folder (I see a lot of dlls) and therefore have a newer version?

I asked already on their forum, but as it seems the development has stopped, so if someone also maybe knows some other good webkit wrapper for .net, please advise, keeping in mind I already tried some of them.


I'm not quite sure why Chrome doesn't fail on this. class is technically a reserved word in Javascript, so you can't create variables with the name class.

Furthermore, you don't need the jQuery wrapper. You can access it through the DOM property className (which is not called class for exactly the same reasons stated above):

var className = this.className;

You can give your variables (and properties and methods etc.) any name you like, except those listed among Javascript's reserved words.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜