agregar onclick que carga la página htm en un área div [cerrado]

I am new to this so excuse my ignorance. I'm working on an image gallery and have added a script to load thumbnails into a div id="loadarea" when mousing over an image link.

I then added a carousel slider to the thumbnail div so I could fit more on thumbs. The carousel slider has a callback called onthumbnailclick that will open the link in a new window, but I would rather it load another div id="imageinfo" with an html page containing detailed image info.

Is this possible. I am very inexperienced with javascript and jquery.

preguntado el 30 de enero de 12 a las 19:01

Yes its possible. Please do some jQuery ajax tutorials, then try to solve the issue yourself, and then post back here with specifics on where you got stuck. -

$('#imageinfo').load(html_goes_here); -

1 Respuestas

Yes, it is possible to load a page into a div using jQuery load method. You should render only the required markup from this page. You can pass data as well to your page using load método.

If you want to do any massaging once the response comes you can do it inside its complete callback handler.

$('#imageinfo').load('imgaeInfo.html', { imageId: 1111 },  function() {
    alert('Image info loaded');

.load() referece:

If you want to just get the content from some section of the you can take a look at Loading Page Fragments en el jQuery load referencia.

Respondido el 30 de enero de 12 a las 23:01

Thank you! I know my question is probably extremely basic. It will take me some time to work through your answer, but I can see how it is what I am looking for. And thanks for showing extra options. I'll post back. - LisaD

Good that made sense to you, mark it as answer whenever you can. - ShankarSangoli

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.