Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

Add CSS gradient with javascript - bug in IE7 -


i trying add gradient on .link.box.gradient in ie7 add on .link.box.gradient , .style.box.gradient

<!doctype html> <html lang="sv">     <head>     <title></title>         <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.4.min.js"></script>         <script>             jquery(function ($) {                 $('head').append("<style>.link.box{height:100px;width:100px;}.link.box.gradient{filter:progid:dximagetransform.microsoft.gradient(startcolorstr='#000000',endcolorstr='#ffffff');}</style>");             });         </script>     </head>     <body>         <div class="style box gradient">gradient (style-tag)</div>         <div class="link box gradient">gradient (link-tag)</div>     </body> </html> 

you can see here too, http://jsfiddle.net/zhvpy/ 1 strange thing when move out .link.box{height:100px;width:100px;} javascript can see here http://jsfiddle.net/zhvpy/1 seems work, dont want move out.

why this? how can fix bug?

removed original incorrect answer

edit 1

odd - decided might way older versions of ie handle elements (like <script />) tried a non-jquery solution. seems work!

edit 2

added full script - outputs different results more in line ie8 outputs

function appendstyle(element, cssobj) {     //$('#a').append($('<span/>').text(cssobjtotext(cssobj)));     if ($.browser.version == 7) {         var head = document.getelementsbytagname('head')[0],             style = document.createelement('style'),             rules = document.createtextnode(cssobjtotext(cssobj));          style.type = 'text/css';          head.appendchild(style);          style.stylesheet.csstext = rules.nodevalue;     }     else {         element.after('<style class="css-finalized">' + cssobjtotext(cssobj) + '</style>');     } } 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -