webmaster webmaster - 1 year ago 609
Javascript Question

Include jscolor in ajax loaded page

I have a index.php page and I am inluding other pages in index.php like this:

function urlpage(url){

jscolor javascript working in index.php but when I load a page (test.php) jscolor not working in this loaded page. What can I do?

I added also this in test.php :

<script type="text/javascript" src="js/jscolor.js"></script>

EDİT : I solved the problem like this :


<script type="text/javascript">
$(document).ready(function() {

Answer Source

You can try to reinitialize jscolor once your load function is done.

$('#page').load(url, function () {
    var myPicker = new jscolor.color($('#myField'), {})

Also check other examples.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download