Changeset - 3ec1ad3d78a8
[Not reviewed]
default
0 2 0
Branko Majic (branko) - 10 years ago 2013-10-26 21:37:57
branko@majic.rs
CONNT-23: Dynamically set-up the base URL for AJAX calls.
2 files changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
conntrackt/static/conntrackt.js
Show inline comments
 
@@ -37,7 +37,7 @@
 
        // Show the search suggestions only if the user has provided 2 or more
 
        // characters.
 
        if (searchField.val().length >= 2) {
 
            request = $.getJSON("/conntrackt/api/search/" + searchField.val())
 
            request = $.getJSON(conntrackt_api_url + "/search/" + searchField.val())
 
                .done(function(data) {
 

	
 
                    // Process the retrieved JSON response, setting-up list of
conntrackt/templates/conntrackt/base.html
Show inline comments
 
@@ -14,6 +14,10 @@
 
    </style>
 
    <link href="/static/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
 
    <link href="/static/custom.css" rel="stylesheet">
 
    <script>
 
    /* Set-up the base URL for sending out AJAX API calls. */
 
    var conntrackt_api_url = location.protocol + "//" + location.hostname + ":" + location.port + {% url "index" %} + "api";
 
    </script>
 
  </head>
 
  <body>
 

	
0 comments (0 inline, 0 general)