Page 1 of 1

link to .php instead of .js file

PostPosted: Sat Nov 28, 2009 9:39 pm
by Anniepannie
Hi there!

I'm trying to slightly customise this great editor, but I'm encountering a slight yet very annoying problem.

I'd like to change the insert link dialog box, so my clients can choose between linking to an external URL, another page on their website, or a photo/file. I'm used to using php to make this possible (making a list of all other pages or images, ...), so I'd like to insert some php parts in the jquery.wymeditor.min.js file.

That, off course as JavaScript is client side, is not possible. Therefore, I was thinking of linking to a php file in the example like this:
<script type="text/javascript" src="../wymeditor/jquery.wymeditor.min.php"></script>
instead of
<script type="text/javascript" src="../wymeditor/jquery.wymeditor.min.js"></script>
and then put the following line in my php file:
<?php header('Content-type: application/javascript'); ?>, before using the content of the original .js file.

Somehow, this also does not work, though, as I for example ask firefox to give me the page information on both files, it gives exactly the same info.

Any solution to this problem?

Re: link to .php instead of .js file

PostPosted: Thu Jan 07, 2010 11:37 am
by mr_lundis
Could you possibly provide a test page? Just guessing what's wrong could take forever.

Cheers! ;)

Re: link to .php instead of .js file

PostPosted: Thu Jan 07, 2010 10:05 pm
by roundash

Try this thread

Basically you can call a php file via ajax from within the dialog.

Hope this helps