Nerfair Nerfair - 7 months ago 40
Javascript Question

Fancybox inline html

Now i am using construction like this

$.post(
location.href,
{
adverts: []
},
function (html) {
$.fancybox({
'content': html,
'type': 'html',
'padding': 0
});
}
);


And everything works fine, if html is only html, but if i add javascript to html,

<script type="text/javascript">

alert('text');

</script>


attempt to open fancybox is crashing with Uncaught SyntaxError: Unexpected end of input

Please notice, in my case i can't use 'href' instead of 'content' for fancybox.

Update

<script>

alert('');

</script>


Fixed the problem, just removed type="text/javascript" part :)

Update:

Any type of quotes breaking fancybox opening ;)

Answer
<script>
    alert('');
</script>

Fixed the problem, just removed type="text/javascript" part.

Update:

Any type of quotes breaking fancybox opening.

Comments