External JavaScript and PHP Problem


Can someone tell me where is the problem ?



```
<script type="text/javascript" src="[http://www.forumistan.net/analiz/analiz.php?site=http://www.forumistan.net](/posts/bad_link/573498?url=http%3A%2F%2Fwww.forumistan.net%2Fanaliz%2Fanaliz.php%3Fsite%3Dhttp%3A%2F%2Fwww.forumistan.net)"></script>
```

analiz.php



```
<?
Header("content-type: application/x-javascript");
ob_start();
include 'all.php';
ob_end_clean();
echo "document.write(\"<div class=\"txt\">Pagerank: $rank->pagerank <br>\")";
echo "document.write(\"Alexa: $rank->alexa_rank</div>\")";
?>
```
try:



```
echo "document.write(\"<div class=\"txt\">Pagerank: ".$rank->pagerank." <br>\")";
echo "document.write(\"Alexa: ".$rank->alexa_rank."</div>\")";
```

in the PHP-code.  

If it doesn't help then open that JS directly in your browser and tell us the error-reporting.
The problem is the response from the server, not your JavaScript. I ran the following code in the console on your page:



```
$.getJSON('data.json', function(data) { 
    console.log(data); 
});

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```

The result looks like this:



  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

 ![enter image description here](https://fooobar.com//img/b0b4666ec951695a00da8c82eb85e737.jpg)


As you can see, there is only one property in the returned object ( `mesta`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

, an array with three elements).


You can confirm this by [visiting the file directly`data.json`
  




 (adsbygoogle = window.adsbygoogle || []).push({});](https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=) . JavaScript *itself* has nothing built in for handling query string parameters. 


Code running in a (modern) browser you can use the [`URL` object](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) (which is part of the APIs provided by browsers to JS):





```
var url_string = "http://www.example.com/t.html?a=1&b=3&c=m2-m3-m4-m5"; //window.location.href
var url = new URL(url_string);
var c = url.searchParams.get("c");
console.log(c);
```









For older browsers (including Internet Explorer), you can use [this polyfill](https://github.com/ungap/url-search-params) or the code from the original version of this answer that predates `URL`:


You could access `location.search`, which would give you from the `?` character on to the end of the URL or the start of the fragment identifier (#foo), whichever comes first.


Then you can parse it with this:





```
function parse_query_string(query) {
  var vars = query.split("&");
  var query_string = {};
  for (var i = 0; i < vars.length; i++) {
    var pair = vars[i].split("=");
    var key = decodeURIComponent(pair[0]);
    var value = decodeURIComponent(pair[1]);
    // If first entry with this name
    if (typeof query_string[key]  "undefined") {
      query_string[key] = decodeURIComponent(value);
      // If second entry with this name
    } else if (typeof query_string[key]  "string") {
      var arr = [query_string[key], decodeURIComponent(value)];
      query_string[key] = arr;
      // If third or later entry with this name
    } else {
      query_string[key].push(decodeURIComponent(value));
    }
  }
  return query_string;
}

var query_string = "a=1&b=3&c=m2-m3-m4-m5";
var parsed_qs = parse_query_string(query_string);
console.log(parsed_qs.c);
```




You can get the query string from the URL of the current page with:



```
var query = window.location.search.substring(1);
var qs = parse_query_string(query);

``` hi [@omar\_jandal](/u/omar_jandal) i found the problem!

somewhere on your site is a interaction fireing on your “article v3” class. [[image]](https://aws1.discourse-cdn.com/business5/uploads/webflow1/original/3x/e/f/ef1234ea647732bbbe8dcba17f1f3301d12dd79e.png "image") [[image]](https://aws1.discourse-cdn.com/business5/uploads/webflow1/original/3x/f/8/f8a0c96ba03678a653e0aa1af8c13d0e631a6558.png "image")

i don´t know where the interaction is set, but if you mind it i would simply change the color in the interaction from purple to green. or just delete it. i have also s… can you try with other dropdowns? if its working , nothing wrong with your code and something to do with that specific drop down. [image]

[how to enable error reporting in php](https://www.000webhost.com/forum/t/how-to-enable-error-reporting-in-php/43038) [tutorials](/forum/c/tutorials)

this tutorial is for those who get internal server error. so your website is not working and you are struggling to find out why. you see error 500 and do not know what to do next. if you try googling error 500 this wil… Since this is an older post, I'm assuming you've solved this issue. Incase others find this post, I'll post the link to the documentation below


 


[https://experienceleague.adobe.com/docs/analytics/components/classifications/c-sub-classifications.h...](https://experienceleague.adobe.com/docs/analytics/components/classifications/c-sub-classifications.html?lang=en#classifications)




[View solution in original post](/t5/adobe-analytics-questions/how-can-i-get-classifications-to-output-correctly-to-the-new/m-p/397907#M27359) Have you tried restarting your browser? maybe by using the [token length filter](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-length-tokenfilter.html) in an analyzer config? May be the function is executed before the document is ready.
Try to use document.ready function like this:



```
$( document ).ready(function() {
    $('#machines').change(function() {
        var $selected = $(this).find(':selected');
        $('#description').html($selected.data('description'));
    }).trigger('change');
});

``` Did you had ACS common installed in your AEM.

<https://adobe-consulting-services.github.io/acs-aem-commons/features/versioned-clientlibs/index.html>




[View solution in original post](/t5/adobe-experience-manager/aem-implementation-of-versioning-for-clientlibs-and-css/m-p/399346#M7116)