Currently, I have a page in SharePoint that can function as a pop-up. I am using JavaScript to identify whether it is a pop-up by checking if
window.location.search.match("[?&]IsDlg=1")
. However, I am struggling to figure out how to insert CSS based on this condition.
One approach I am considering is adding a label to the page and then using code behind to determine the condition and insert the CSS. But I also want to explore the possibility of achieving this through JavaScript. Can someone please provide guidance?
I believe I could potentially use jQuery like this:
$('<style type="text/css">#foo { background: #000; } </style>').appendTo("head");
Thank you.