Need some Javascript relative path help with Responsive HTML 5 output please

Explorer ,
Mar 15, 2016

Copy link to clipboard

Copied

I have my feedback working with the javascript code below linked to an image. Problem is that only the html files in the root are showing my image. How can I get the pages in subfolders to also find the image?

var mailSubject = 'Feedback on Offline Help File and/or Documentation';

var mailBody    = 'The page I was visiting was:  ' + location.href;

var mailDisplay = 'Email Feedback';

var bodyline =  '%0A%0APlease add your comments here:%0A%0A%0A%0A%0A%0A%0A%0AThank you for your valuable feedback.' ;

document.write(

  '<a title="Send Feedback on Help File and Documentation" href="mailto:xyz@company.com'

  + '?subject=' + escape(mailSubject)

  + '&body=' + escape(mailBody) + (bodyline)

  + '"><img src="./ImageRepository/feedbackicon.jpg" title="Email Feedback" border="none" alt="" /></a>'

);

TOPICS
HTML

Views

139

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Need some Javascript relative path help with Responsive HTML 5 output please

Explorer ,
Mar 15, 2016

Copy link to clipboard

Copied

I have my feedback working with the javascript code below linked to an image. Problem is that only the html files in the root are showing my image. How can I get the pages in subfolders to also find the image?

var mailSubject = 'Feedback on Offline Help File and/or Documentation';

var mailBody    = 'The page I was visiting was:  ' + location.href;

var mailDisplay = 'Email Feedback';

var bodyline =  '%0A%0APlease add your comments here:%0A%0A%0A%0A%0A%0A%0A%0AThank you for your valuable feedback.' ;

document.write(

  '<a title="Send Feedback on Help File and Documentation" href="mailto:xyz@company.com'

  + '?subject=' + escape(mailSubject)

  + '&body=' + escape(mailBody) + (bodyline)

  + '"><img src="./ImageRepository/feedbackicon.jpg" title="Email Feedback" border="none" alt="" /></a>'

);

TOPICS
HTML

Views

140

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 15, 2016 0
Captiv8r LATEST
LEGEND ,
Mar 15, 2016

Copy link to clipboard

Copied

Hi there

There is likely a way to code it so the image is found using the pathing. But if I were in your shoes, I would likely abandon attempting to sort the pathing and simply copy the image to each folder in my project. Then amending the code so it simply references the image. Not very pretty, but it should work.

Cheers... Rick

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 15, 2016 1