本文介绍了如何将Javascript代码转换为Jquery代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我,这是Javascript中的代码,我需要将此代码更改为Jquery.

Please help me, here is the code in Javascript, I need to change this code to Jquery.

eval("parent.document.forms[0].strKey" + 
      intDimensionId).value = strIds[intDimensionId];

推荐答案

高性能:最小jQuery:$('form:first')[0]["strKey" + intDimensionId].value = strIds[intDimensionId];

high performance:minimal jQuery: $('form:first')[0]["strKey" + intDimensionId].value = strIds[intDimensionId];

不如高性能:完整的jQuery:$('form:first *[name="strKey' + intDimensionId + '"]').val(strIds[intDimensionId]);

not as high performance:full jQuery: $('form:first *[name="strKey' + intDimensionId + '"]').val(strIds[intDimensionId]);

这篇关于如何将Javascript代码转换为Jquery代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 19:20