php - Yii: div htmlOptions drops after ajaxLink was triggered -


so have empty div, kinda shell, style attribute:

<div id="res" style="z-index: 99"></div> 

div's content loading ajaxlink:

chtml::ajaxlink('toggle','my/action',array(     'success'=>'function(html){ $("res").html(html); }' )); 

but after content loaded, style attribute replaced.

thq question is: may ajaxlink keep current setting?

you got lot of mistakes in code , software pattern. ... lets give try:

1) jquery selector wrong. tried select "res" tags. take @ correct selector. http://api.jquery.com/category/selectors/

chtml::ajaxlink('toggle','my/action',array(     'success'=>'function(html){ $("#res").html(html); }' )); 

2) http://api.jquery.com/html/ not replace div, append html childs nodes. thats why, div never changed. means, problem not missing "style" attribute.

3) tip: dont use inline css style. go on css-classes like

   #res { z-index:99 } 

4) try debug in frontend/console:

chtml::ajaxlink('toggle','my/action',array(     'success'=>'function(html){ console.log(html); $("#res").html(html); }' )); 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -