-1

I was doing some color changes to a site and i only have access to a portion of the site. They have several pages , but not all load the same header and stylesheets. I wanted to know if it's possible to style a page with that limitation.

I am working on www.mysite.com/2015/home/25902 and have access to edit the header , link stylesheets , input jquery

The same server has another page with url www.mysite.com/2015/ajax_ld?L=25902

So was curious if i could do any ajax / jquery from my page access to force onto the other page , which isn't loading my head / stylesheets ? CORS is enabled throughout this site.

Never heard of doing this before , but thought i'd ask....thanks

MShack
  • 642
  • 1
  • 14
  • 33
  • 1
    No that's not possible. If your styles and scripts aren't loaded on that page, you can't do anything. – Sjors Jul 04 '15 at 15:26
  • If you can execute JavaScript, you could simply embed a stylesheet that way, by creating either a `link` or a `style` element dynamically … – CBroe Jul 04 '15 at 15:30
  • i can execute javascript on the page i have access to , but i can not load anything on the new page i wish to add some style to. Is that possible still, if so , how ? – MShack Jul 04 '15 at 15:35

2 Answers2

1

If on the same domain, you can load the page you want to add the CSS to into a page you created, and therefore, have full control over it.

 <!DOCTYPE html>
    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
    $("#loadedpage").load("targetpage.html");
    });
    </script>
    <link rel="stylesheet" type="text/css" href="yourcssfile.css">
    </head>
    <body>

    <div id="loadedpage"></div>

    </body>
    </html>
Gary Hayes
  • 1,728
  • 1
  • 15
  • 23
0

hey dude if you can attach style sheet than you can apply css too may be you are try to say that the html come or generated by third party or else that you don't know ( means you just need to use it )

now one thing i want to say that if you can load that page with your script or if you can apply javascript or jquery then YES it's possible for how that you can refer below link on which i have give my try

select a span with a text inside a div using css

Community
  • 1
  • 1
Himesh Aadeshara
  • 2,114
  • 16
  • 26