i have started a web page with dreamweaver and have a link to a photoshop web gallery on the home page. the gallery is seperated into three different thumbnail pages. when i went to test out the pages on the web browser all the links worked fine except for when i hit the back button that photoshop's gallery provided on the second thumbnail page to go back to the first thumbnail page, when i tried this i got sent to the page that says internet cannot display web page, can any one help?

Dani AI

Generated

The error you saw usually means the gallery link is resolving to a path that does not exist on the server. had a Photoshop-generated gallery linked from a Dreamweaver page; 's quick fix used the browser history to return and that solved the immediate problem. For a longer-term fix, verify why the link is pointing to the wrong place and add a resilient fallback.

Checklist to debug and fix

  • Confirm the entire gallery folder and its subfolders were uploaded and preserved. Photoshop generators expect their folder structure to stay intact.
  • Inspect the gallery HTML (View Source or DevTools) and note the back control's href. Use the Network panel while clicking the control to see the exact URL the browser requests.
  • If the href resolves relative to the current folder and ends up missing, change it to a correct root-relative or absolute URL that points to the gallery's first thumbnail page, or keep the existing href as a fallback and add JavaScript to use the browser history when possible.

Unobtrusive, robust approach
Add an id to the back link and attach a handler that uses the history only when there is a meaningful previous page; otherwise let the anchor href act as the fallback:

(function () {
  var btn = document.getElementById('backBtn');
  if (!btn) return;
  btn.addEventListener('click', function (e) {
    if (history.length > 1) {
      e.preventDefault();
      history.go(-1);
    }
  }, false);
})();

Avoid placing inline JavaScript in href attributes; use an anchor with a real href for accessibility and SEO. See the MDN notes on the History API and on relative links for details: History.back() — MDN and Creating hyperlinks — MDN.

Recommended Answers

All 5 Replies

Sounds like the link on the back button is wrong. Post some code or a link to the page.

<a href="index.html"><IMG SRC="images/arrow_prev.gif" BORDER=0></a>

this is the code for the broken link

....I'm really new at all this!!!

Replace this: <a href="index.html"><IMG SRC="images/arrow_prev.gif" BORDER=0></a> with this: <a href="javascript:history.back()"><img src="images/arrow_prev.gif" border="0"></a>

thank you very much!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.