Ciao Richard,
thanks a lot, really.

It, clearly, works.

But, if I may ask you more, if I would to pass an address with the
same problem to a jQuery selector, what should I write?
Would it enough to create a variable and insert its name into the
selector?
Below it is an example:

    var my_variable_name = '"' + document.location.hostname + '/folder/
subfolder/file.html';

    jQuery(my_variable_name).something;

Would it be right? That is just to learn.
Thanks anyway again for your help.

On Nov 8, 3:02 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> No need to provide the full URL, including the domain/server name. In fact,
> there's a security restriction on Ajax that prevents fetching an html page
> from a domain other than the current one, so you only need to specify a
> relative url to load:
>
> jQuery('#footer-navbar').load("/clients/clickadvisor-02/snippets/footer-
> navbar.html");
>
> - Richard
>
> On Nov 8, 2007 6:04 AM, caruso_g <[EMAIL PROTECTED]> wrote:
>
>
>
> > I should have made progresses, I hope.
>
> > I saw that it would be better to use .load method to get some simple
> > pre-formatted html bunch of code.
>
> > But the problem is still there, I don't know how to pass as arguments
> > a domain address I am not able to know in advance.
> > So I tried with the code below, but it doesn't work:
>
> >        function address() {
> >                var website = document.location.hostname;
> >                var snippet_address = '"' + website +
> > '/clients/clickadvisor-02/
> > snippets/footer-navbar.html"';
> >                document.write(snippet_address);
> >        }
>
> >        jQuery('#footer-navbar').load("address();");
>
> > Any suggestion?
>
> > On Nov 7, 10:45 pm, caruso_g <[EMAIL PROTECTED]> wrote:
> > > First of all I want to apologize with all devs out there for my
> > > questions. I am sure that solution will be easy but I am just a
> > > designer, so I am a moron with Javascript...
>
> > > The problem is that I need to put some html code into a div (#footer-
> > > navbar) getting the html code from a page of which I already know its
> > > hierarchy (clients/clickadvisor-02/snippets/footer-navbar.html) but of
> > > which I don't know its domain (http://www.I_DONT_KNOW_THIS.COM).
> > > I tried to create a script with jQuery like this:
>
> > > jQuery('#footer-navbar').html(function () {
> > >   jQuery.get(function () {
> > >     document.write('"' + this.location.hostname + 'clients/
> > > clickadvisor-02/snippets/footer-navbar.html"')
> > >     });
>
> > > });
>
> > > Where do I make a mistake?
>
> > > Thanks in advance to everyone.
>
> > > ps
> > > I am making use of "jQuery" because of some incompatibilities with
> > > other libraries.

Reply via email to