Git Product home page Git Product logo

Comments (9)

furious-luke avatar furious-luke commented on July 19, 2024

The autocomplete on the example site in exampes/example_site seems to be working properly. A typical cause for this kind of error is not including the geocomplete JavaScript file. Did you use the form.media method of including the JavaScript, or are you doing it manually?

from django-address.

jplehmann avatar jplehmann commented on July 19, 2024

I used form.media, and upon examining the HTML source I see this in the
head:

<script src="
https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="
https://maps.googleapis.com/maps/api/js?libraries=places&amp;sensor=false
"></script>
<script type="text/javascript"
src="/static/address/js/jquery.geocomplete.js"></script>
<script type="text/javascript"
src="/static/address/js/address.js"></script> <!-- needed for JS/GoogleMaps
lookup -->```

However I am also already including Jquery at the bottom of my body. Could
this be interfering?

On Fri, Jan 8, 2016 at 3:34 PM, Luke Hodkinson <[email protected]>
wrote:

> The autocomplete on the example site in exampes/example_site seems to be
> working properly. A typical cause for this kind of error is not including
> the geocomplete JavaScript file. Did you use the form.media method of
> including the JavaScript, or are you doing it manually?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/furious-luke/django-address/issues/33#issuecomment-170134094>
> .
>

from django-address.

jplehmann avatar jplehmann commented on July 19, 2024

Yea as soon as I move this below to the bottom of the body, below where I
import my own JQuery (1.x) it works.

On Fri, Jan 8, 2016 at 5:10 PM, John Lehmann [email protected] wrote:

I used form.media, and upon examining the HTML source I see this in the
head:

<script src="
https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
"></script>
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="
https://maps.googleapis.com/maps/api/js?libraries=places&amp;sensor=false
"></script>
<script type="text/javascript"
src="/static/address/js/jquery.geocomplete.js"></script>
<script type="text/javascript"
src="/static/address/js/address.js"></script> <!-- needed for JS/GoogleMaps
lookup -->```

However I am also already including Jquery at the bottom of my body. Could
this be interfering?

On Fri, Jan 8, 2016 at 3:34 PM, Luke Hodkinson <[email protected]>
wrote:

> The autocomplete on the example site in exampes/example_site seems to be
> working properly. A typical cause for this kind of error is not including
> the geocomplete JavaScript file. Did you use the form.media method of
> including the JavaScript, or are you doing it manually?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/furious-luke/django-address/issues/33#issuecomment-170134094>
> .
>


from django-address.

furious-luke avatar furious-luke commented on July 19, 2024

Okay, no problems. I'll add a section to the documentation about using your own jQuery.

from django-address.

jplehmann avatar jplehmann commented on July 19, 2024

Hi Luke, you might answer this in your docs about custom JQuery, but here's where I'm currently stuck at: I am using JQuery version 1.11.3 just for maximum compatibility across devices etc. This gets run first. I then run Bootstrap's JQuery plugin. Finally I include django-address media tag, which brings in:

<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=places&amp;sensor=false"></script>
<script type="text/javascript" src="/static/address/js/jquery.geocomplete.js"></script>
<script type="text/javascript" src="/static/address/js/address.js"></script>

It appears to be running a local version of JQuery which its installed in my static path. (Note I didn't even include the explicit call to JQuery 2 which your dev-branch only docs show).

The net effect is I get some errors from later calls to the Bootstrap plugin (popover and collapse) which are not known. Clearly this is caused somehow by multiple JQuery versions, but I don't have a lot of depth here.

Questions:

  1. Many of your users will already have JQuery so do you want to include it by default as you are doing or does it make more sense to have them include it explicitly like your docs showed in the dev branch?
  2. Would django-address and its dependencies work properly with JQuery 1.x? I am happy to test that out.

from django-address.

furious-luke avatar furious-luke commented on July 19, 2024

The media approach to including JavaScript is useful for basic needs, but if you wish to include your own versions of plugins you'll need to include all the JavaScript manually, not using media.

I've not tested against jQuery 1.x, it really comes down to whether jquery.geocomplete can handle it. Certainly the django-address JavaSript would be fine with jQuery 1.x, as it's nothing more than a simple function call.

from django-address.

jplehmann avatar jplehmann commented on July 19, 2024

Ah ya, that is obvious I guess. Works perfectly (don't see a problem with
1.x). Thanks!

On Sun, Jan 10, 2016 at 4:33 PM, Luke Hodkinson [email protected]
wrote:

The media approach to including JavaScript is useful for basic needs, but
if you wish to include your own versions of plugins you'll need to include
all the JavaScript manually, not using media.

I've not tested against jQuery 1.x, it really comes down to whether
jquery.geocomplete can handle it. Certainly the django-address JavaSript
would be fine with jQuery 1.x, as it's nothing more than a simple function
call.


Reply to this email directly or view it on GitHub
#33 (comment)
.

from django-address.

jplehmann avatar jplehmann commented on July 19, 2024

I'll let you close this once you add whatever documentation you wanted to.

from django-address.

banagale avatar banagale commented on July 19, 2024

I'm going to close this, since this is very old and I do not know if we will want to require jquery in 0.3.0.

from django-address.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.