Reputation: 11
I'm very new to this, so I'm sorry if I cant explain myself properly. I'm running a website with a lightbox for images, inside the lightbox I embeded a link and what I want to do is that link to open a new pop-up window, but I've encountered a small problem on my code:
<a href="images/gallery/1.jpg" class="lytebox" data-title="<br /><a href='javascript:popUp('images/junk1.php')'/>Add a Comment</a>">
<img src="images/thumbnails/1.jpg" border="0">
</a>
You see, when I get to the 'javascript:popUp('images/junk1.php')'
I've already used the apostrophes, so it doesn't load. I've been reading about strings being within strings and I've tried escaping it via \ but it doesn't work. Any help?
Upvotes: 1
Views: 322
Reputation: 17667
ok.. how about you just change the call around a little.. not sure if this will work, but you could give it a try.
<a href="images/gallery/1.jpg" class="lytebox" data-title="<br /><a data-img='images/junk1.php' onclick='popUp(this.dataset.img)'/>Add a Comment</a>"><img src="images/thumbnails/1.jpg" border="0"></a>
or you can do as rob suggests...
<a href="images/gallery/1.jpg" class="lytebox" data-title="<br /><a href='javascript:popUp("images/junk1.php")'/>Add a Comment</a>">
<img src="images/thumbnails/1.jpg" border="0">
</a>
Upvotes: 0
Reputation: 360056
Use HTML entities. Something like this (not tested):
data-title="<br /><a href="javascript:popUp('images/junk1.php')"/>Add a Comment</a>"
Upvotes: 1