jQuery: The Write Less, Do More JavaScript Library

parameters to jquery’s .load()

View: New views
2 Messages — Rating Filter:   Alert me  

parameters to jquery’s .load()

by Wouter-25 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hello,

I have to files ans the first one index.html I use all the
javascripts. As you can see in my script i like to load
"aanmelden.html". In this page U like to uise a callander. How can I
use the calanderfunction without putting the javascript directly into
aanmelden.html

$(document).ready(function() {
    $("img[rel]").overlay(function(){
     $("#aanmelden_page").load("pages/
aanmelden.html",'#startDatepicker,#endDatepicker');
      $('#startDatepicker,#endDatepicker').datepick({beforeShow:
customRange,
       showOn: 'both', buttonImageOnly: true, buttonImage: 'images/
calendar.gif'});
    });



        function customRange(input) {
            return {minDate: (input.id == 'endDatepicker' ?
                $('#startDatepicker').datepick('getDate') : null),
                maxDate: (input.id == 'startDatepicker' ?
                $('#endDatepicker').datepick('getDate') : null)};
        }

etc..

Re: parameters to jquery’s .load()

by panxponx :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

in jquery you can find $.getScript() function.... wich is part of ajax way to retrieve javascript on the fly... so the script is not needed to be put on the page but loaded asynchronously before or after the page loaded depend on when u need the script...

Best Regards
Darwin Liem

--- On Wed, 11/11/09, Wouter <vanreeven@...> wrote:

From: Wouter <vanreeven@...>
Subject: [jQuery] parameters to jquery’s .load()
To: "jQuery (English)" <jquery-en@...>
Date: Wednesday, November 11, 2009, 4:37 AM

hello,

I have to files ans the first one index.html I use all the
javascripts. As you can see in my script i like to load
"aanmelden.html". In this page U like to uise a callander. How can I
use the calanderfunction without putting the javascript directly into
aanmelden.html

$(document).ready(function() {
    $("img[rel]").overlay(function(){
          $("#aanmelden_page").load("pages/
aanmelden.html",'#startDatepicker,#endDatepicker');
           $('#startDatepicker,#endDatepicker').datepick({beforeShow:
customRange,
                showOn: 'both', buttonImageOnly: true, buttonImage: 'images/
calendar.gif'});
    });



    function customRange(input) {
        return {minDate: (input.id == 'endDatepicker' ?
            $('#startDatepicker').datepick('getDate') : null),
            maxDate: (input.id == 'startDatepicker' ?
            $('#endDatepicker').datepick('getDate') : null)};
    }

etc..