开发者

Jquery UI Portlets - Loading and Editing portlet using Ajax

All,

I am trying to create an igoogle interface using PHP, MySQL and JQuery UI and I stumbled on jquery UI's portlets over here:

http://jqueryui.com/demos/sortable/portlets.html

For each portle开发者_如何学运维t, is there a way:

  1. To specify a URL and load ajax content?
  2. To have an edit button, that will edit the portlet in place. The editing content can come through a

    URL using ajax.

For additional details,look at "Edit" functionality here:

http://james.padolsey.com/demo/tut-inettuts-with-cookies/

Thanks


You can change the content of the portlets with something like this example:

http://jsbin.com/imese4/2

You could use load() instead of .html() (used in the example for simplicity).

$(".portlet").each(function(element){
      $(this).children(".portlet-content").load("content.php?id="+element);
});

To edit the content do something like this:

$(".portlet-edit").click(function(element){
  s=prompt('Enter your content','Content');
  $(this).parent().children(".portlet-content").html("edited:" + s);
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜