Page 1 of 1

Jquery in edit_post.php not working.

Posted: Tue Nov 12, 2013 8:56 am
by Tinydan
For some reason jquery doesn't seem to activate on the edit_post.php page. it includes the footer.inc.php file in the same was as the admins new_ticket.php page so I don't believe it has something to do with the way the jquery files are accessed. I've got all the classes correct as well so I'm really not sure what the problem is. its not the biggest problem, it being a page end users will hopefully never see but it'd still be nice to have jquery working there too. Is this a problem anyone else has experienced or is it just me?

Re: Jquery in edit_post.php not working.

Posted: Tue Nov 12, 2013 4:33 pm
by Klemen
HESK doesn't use Jquery, is this something you added?

Re: Jquery in edit_post.php not working.

Posted: Tue Nov 12, 2013 5:01 pm
by Tinydan
Yeah, quite simple to get it integrated too. Its allowed me to have some pretty fancy controls its just the JavaScript that activate those controls doesn't seem to want to fire on the edit_post page.

Re: Jquery in edit_post.php not working.

Posted: Tue Nov 12, 2013 5:03 pm
by Tinydan
I had thought perhaps the page includes the footer.txt file differently but its no different to how the other pages that use it include it.

Re: Jquery in edit_post.php not working.

Posted: Tue Nov 12, 2013 5:23 pm
by Klemen
Correct, the footer.txt is included the same way in all pages.

If you look at the source code the JS is not there on the edit_post.php file?

Re: Jquery in edit_post.php not working.

Posted: Wed Nov 13, 2013 9:04 am
by Tinydan
That's odd. The page calls footer.inc.php in the same way and that obviously works as the License is included in there. for some reason the script that I have in there aren't being called. I tried placing this code in the edit_post page

Code: Select all

<script type="text/javascript" src="/inc/script/chosen/jquery.min.js"></script>
<script type="text/javascript" src="/inc/script/chosen/chosen.jquery.js"></script>
<script type="text/javascript">$(".chzn-select").chosen({disable_search_threshold: 10, width:"200px", placeholder_text_single:" ", search_contains: true, allow_single_deselect: true });</script>

Now the controls are all working. It just doesn't make sense that they wouldn't work in the one page while working in all the others. This makes me think that edit_post.php is just not getting to the javascript in the footer.inc.php file.

Re: Jquery in edit_post.php not working.

Posted: Wed Nov 13, 2013 9:15 am
by Tinydan
Oh i don't know anymore. I've just tried putting the code into footer.txt again and its all working fine now. :oops:

I've been working with Hesk for a couple of weeks and I'm still getting comfortable with the source. When i was first trying to integrate JQuery I found that including the code in the footer.inc file was working so I kept it even after I started using footer.txt for some scripts.

Well its all working now so thanks for being about to throw some ideas at Kelmen you've made a very impressive system here and I'm enjoying using it and modifying it.