0

I am looking for some info on JSP imports. I currently have a main.jsp. A jsp is loaded into a div using jQuery upon user selection of of an item. then inside of that div, a modal dialog is opened upon another selection, and a jsp is loaded into that. All the data is coming back ok, but the CSS formatting is off. Each of the JSPs has a head and body and can run separately. They look fine alone, but start getting different CSS attributes when together. Should I be able to strip off the head and body of the second and third loaded JSP, incude all the necessary js and css files in the main and have it work fine? Do I need to have the head and body tags? I am using a jQuery .load() call.

bob
  • 1
  • 1

2 Answers2

0

You do not need to include head and body tags in the content that is being loaded via the jquery load call.

When you do model popups, jquery moves your div markup to the end of the document. So if you had some css that was pretty specific, such as

#content #model { ... }

It wouldn't work because jquery will move the markup to the bottom of your page.

CtrlDot
  • 2,463
  • 14
  • 11
-1

You don't need to have body or head tags for loaded pages. Unfortunately if you want reliable cross-browser formatting for loaded pages it's better to go with inline styles for them. Not sure if IE9 will have this fixed, but I beleive earlier versions ignore style for loaded pages whether it's specified in the main page or loaded page itself.

AR.
  • 1,935
  • 1
  • 11
  • 14