Load CSS and JS using absolute paths on select pages

Solutions

I had a look at how the web_widgets module was making CSS/JS paths absolute and it looks like a valid solution is just to alter $GLOBALS['base_path'] to add the URL of my site. An easy way to do this is with url():

  $GLOBALS['base_path'] = url('', array(
    'absolute' => TRUE,
  ));

Similar questions

How to map old paths to Drupal paths
I'm converting a Wordpress blog to Drupal and need to map the WP paths to the new Drupal ones. What's the best practice for doing this? There are only around a hundred pages to map. I've been experimenting with the URL Alter module, which provides an alternative to messing with custom_url_rewrite functions settings.php but keep getting 404. Waiting...
absolute url of inline images in body using views and services
I am using services module in Drupal 8 to output node body in JSON format. The inline images are broken in android app which uses json to render node. Is there any code/method or module for D8 which can rewrite relative inline images path to absolute. My drupal version is 8.0.5
Drupal 7: How to load js and css files on different pages
What is the best way to load a js and css file on certain pages (not on every single page like happens when using the .info file)?
How to load a theme's clear.css before system.css and other module stylesheets?
So, I'd like to use a CSS reset (such as http://bit.ly/gd2hQX) as part of a theme I'm assembling. This will help me avoid assorted headaches with user agent defaults. I dutifully mention clear.css in mytheme.theme, and turn on Drupal's CSS optimization so it will get loaded into the CSS cache file that becomes part of $scripts in page.tpl.php. But,...
Lazy load making pages freeze/load very slow on IE?
I'm working on a Drupal site that had lazy load implemented into it because it is very image heavy. The feature works on every browser but IE, in which the page periodically freezes when scrolling down to see images due to a "long running script". It seems like this is something of a known issue, but I can't seem to find a conclusive fix for the pr...
How do I get the absolute URL when using l()?
I want to get <a href="http://site.ru/node/123">New product</a> from l(), and I call it as l('New product', 'node/123'), but this function generates a URL that is not absolute. How can I generate an absolute URL with l()?

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.