Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative url fix #47

Open
hidekiyamamoto opened this issue Jan 18, 2013 · 0 comments
Open

Relative url fix #47

hidekiyamamoto opened this issue Jan 18, 2013 · 0 comments

Comments

@hidekiyamamoto
Copy link

Something the likes of this, may help other solve their problem... of course you should write this one less obstrusive... making the changes only in the selected elements instead of the entire document... but still it works.

uno.print=function(jq,options){uno.norelativeurls();jq.printElement(options)};
uno.norelativeurls=function(){var aa=document.getElementsByTagName('img');
for(var a=0;a<aa.length;a++){
if(uno.startswith(aa[a].src,'http://')){continue;}
if(uno.startswith(aa[a].src,'https://')){continue;}
aa.src=uno.host+location.pathname+aa.src;}};

//Fixes on the fly the issue about images not having relative image src urls not showing correctly in chrome and other browsers where the url above is "about:blank"
//Usage : uno.print(jQuery('#elmid'),{OPTIONS HERE})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant