开发者

using jwysiwyg and validation issues

I'd like to focus the cursor in the jwys开发者_运维知识库iwyg iframe when the user forgets to enter a value but I'm not sure how to do this. Can someone help please?


First of all, there is no mechanism for moving the mouse via javascript.

To focus in iframe use this script (if you use jquery)

$(".wysiwyg").find("iframe").focus();

To access the content of iframe you have to use the above script :

    $(document).ready(function(){
    $(".wysiwyg").find("iframe").load(function(){
       var test =  $(".wysiwyg").find("iframe").contents().find('body').html();
       //do job with the content.
       //Remember that jwysiwyg will produse some code even if it seems there is 
       //nothing.(couse the wysiwyg is base on browser behavor
    });
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜