2

I am developing a web application and I would like to be able to show a full web page inside an L.marker popup window with fixed size... Until now I figured out how to run some php or html in the popup. code:

var k= new L.marker( [markers[0].lat, markers[0].lng], {icon: myIcon} )
    .bindPopup( '<a href="' + markers[0].url + '" target="_blank">' + markers[0].name + '</a>' )
    .addTo( map );
    k.setPopupContent('<?php $user=$userRow['username']; echo $user; ?>');

This one obviously shows the username in the popup window. The thing is, that if would like to write my html or php in a separate file and include it with php, or even write my code straight inside the setPopupContent function, I would have to write all of my code in a straight line. So is there any other thoughts on how to do this so that I wont have to write my pages in a single line?

1 Answer 1

1

I found a solution for now by simply putting a '\' char at the end of each line inside my other php or html files

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.