开发者

Jquery .load need page refresh but but also return false - help

Hi folks this is prob quiet simple but not sure how to do it.

I am loading pages into a div a simple like this:

$('.pageLink').click(function() {
var pagetoload = ($(this).attr('href').substring(5));
$('#adminArea').load(pagetoload+'.php');
return false;
});

That works no probs at all. 开发者_如何学GoOnly thing is that I am using CKEditor on "several"of the loaded pages and to display CKEditor in all the pages it seems to require a page refresh I know this is TOTALLY wrong and does not work (obviously) but it gives you an idea of what is needed, just how do you achieve it - if it is possible.

$('.pageLink').click(function() {
var pagetoload = ($(this).attr('href').substring(5));
return true;
$('#adminArea').load(pagetoload+'.php');
return false;
});

any ideas? - thanks in advance


When implementing CKE you have to use a code segment like below.

CKEDITOR.replace( 'editor1' );

While you are accessing from Ajax this is called before the editor is attached to the page. You can try one thing. After loading your ajax content, then call the CKEDITOR.replace() function on a specified control again. This might solve your problem.

[EDIT]

$('#adminArea').load(pagetoload+'.php');
CKEDITOR.replace( 'EDITOR' );

[EDIT 2]

$('#adminArea').load(pagetoload+'.php', function() {
  CKEDITOR.replace( 'EDITOR' );
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜