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.

Need help with: jquery prepend doctype to html -


here's situation:

  1. i editing application's css style sheet.
  2. i can edit css style sheet (unless can creatively glom onto file using css, or possibly add small jquery prepend statement in existing .js)
  3. application ie6, ie7 , ie8 compliant. never use firefox, , it's not option.

looking with:

1) think need use jquery "prepend/prependto" "doctype " on to

html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" 

without !doctype throws ie8 quirksmode , of course doesn't accept styles such "input[type=checkbox]"

i have not used prepend before. can me full , correct syntax on how make following:

current: <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

desired: <doctype html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

this has not worked me yet $("html ").prepend("doctype ")

it's not <doctype html>. it's:

<!doctype html> <html (xmlns or other attributes want)> 

<!doctype not element. has <! @ start, invalid element. the “doctype declaration”, , cannot usefully altered after initial parsing.

even on browsers dom interfaces let move/replace documenttype node representing doctype declaration, not have effect of changing between quirks , standards mode, decided only @ initial load time. cannot mutate document between modes.

you can load new document existing document changed mode:

<!-- no doctype, loads in quirks mode (backcompat) --> <html>     <!-- rest of document, @ end: -->      <script>         alert('now in compatmode '+document.compatmode);         if (document.compatmode==='backcompat') {             settimeout(function() {                 var markup= document.documentelement.innerhtml;                 markup= '<!doctype html><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">'+markup+'</html>';                 document.open();                 document.write(markup);                 document.close();             }, 0);         }     </script> </html> 

but advise against it. it's ugly, reset state , redraw @ end of load time, , has sorts of negative implications scripting.

if want standards mode, need adding doctype html itself. if absolutely can't touch application, how using isapi filter (assuming web server iis) add doctype html output?


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 -