h,
i have this for call the hs.expand using a link:

<a onclick="return hs.htmlExpand(this, { contentId: 'highslide-html2', objectType: 'iframe', objectWidth: 400, objectHeight: 400} )"
class="highslide"href="link"><call  </a>

that work fine, but now i want call the same function using a function like this:

hs.htmlExpand(null, {
      contentId: 'highslide-html2', objectType: 'iframe', objectWidth: 400, objectHeight: 400 ,src: 'www.site.com'}   );

but that don´t work this don´t display any error simple don´t do nothing!
what i doing wrong?
thanks a lot for your help
:)

Dani AI

Generated

Short summary and practical checklist for : the anchor call works because the link element supplies both the source URL and the visual anchor for the animation. When calling Highslide from script (calling hs.htmlExpand with a null element) the options used are slightly different — contentId is for inline HTML blocks, while an iframe needs an explicit src (and usually no contentId). This distinction is shown in common Highslide examples. (stylifyyourblog.com)

Two frequent reasons a programmatic call "does nothing": the src value is not a valid absolute URL (for example "www.site.com" is treated as a relative path unless it starts with http:// or https://), and the remote site disallows framing (via X-Frame-Options or a CSP frame-ancestors rule). Check the browser console and Network tab for a 4xx/blocked response or a framing policy message. (developer.mozilla.org)

Minimal, working pattern (call from script — not identical to snippets already in the thread):

hs.htmlExpand(null, {
  objectType: 'iframe',
  src: 'https://example.com/',     // full URL with protocol
  width: 400,
  height: 300
});

If the popup should animate from a point or a click, provide pageOrigin (x/y) or pass the actual anchor element instead of null. Programmatic popups shown in chart examples use pageOrigin for positioning. (stackoverflow.com)

Quick troubleshooting checklist:

  • Confirm highslide JS/CSS files and basic hs. settings are loaded before the call.
  • Use a fully qualified src (include http(s)://).
  • Inspect Network/Console for blocked frames (X-Frame-Options or CSP) — if blocked, embedding will fail and opening in a new tab or proxying is required.
  • Test with a simple page known to allow framing to separate Highslide configuration issues from framing policy or URL problems. (iwebunlimited.com)

Note: was right to point at the docs; the example from @PedroJose still used a bare "www.site.com" which will usually be treated as a relative URL, so switching to a full https://... address is the simplest fix.

Recommended Answers

All 3 Replies

JavaScript != JSP (Java Server Pages). Moved

http://www.highslide.com/ref/hs.htmlExpand

From what I read you should omit contentId. If this is not the case, try the highslide forum, they are quite responsive and helpful.

srdva59, Try it:

return hs.htmlExpand(null, {contentId: 'highslide-html2', objectType: 'iframe', objectWidth: 400, objectHeight: 400 ,src: 'www.site.com'} );

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.