Why not run the jquery script?

Friends ,when you upload your site load through Ajax a php file which is loaded tpl file

<script async>document.addEventListener("DOMContentLoaded", function(event) { $.ajax({ url:'/ajax/cities.php', success: function(mes){ $('.footer1512-container').before(mes);}});});</script>


cities.php

<?
session_start();
require_once('../api/Simpla.php');
 $simpla = new Simpla();
 $all_cities = $simpla->cities->all_cities();
 if( isset($_SERVER['HTTPS'] ) ) { 
 $simpla->design->assign('protocol', 'https://'); }
 else { $simpla->design->assign('protocol', 'http://');}
 $text = $_SERVER['HTTP_REFERER'];
 $array = explode("/",$text); // process the string into an array
 $array = array_slice($array,3); // select the first 5 words-elements
 $array = implode("/",$array);
$domain=explode('.',$_SERVER['SERVER_NAME']);
 if(sizeof($domain)>2) {$domain=substr($_SERVER['SERVER_NAME'],strpos($_SERVER['SERVER_NAME'],'.')); preg_match("/[^\.\/]+\.[^\.\/]+$/", $domen, $matches); $domain = ".".$matches[sizeof($matches)-1];} else $domain = ".".$_SERVER['SERVER_NAME'];
 $simpla->design->assign('domain', $domain);
 $simpla->design->assign('script', $array);
 $simpla->design->assign('all_cities', $all_cities);
 $result = $simpla->design->fetch('setcity.tpl');
 header("Content-type: application/json; charset=UTF-8");
 header("Content-Encoding: gzip");
 header("Cache-Control: must-revalidate");
 header("Pragma: cache");
 header("Expires: -1"); 
 print gzencode(json_encode($result), 9);


in essence the code insight is not worth it, but in the end we loaded tblco before the block basement.

$result = $simpla->design->fetch('setcity.tpl');

Thus, on the tpl need to load a popup that event on the button.

$().ready(function() {
 $('.city_frame').jqm({trigger: '.city_btn'}).addClass('show');
 });


But for some reason it doesn't work. How to make friends?
April 19th 20 at 12:45

Find more questions by tags jQuery