Jump to content

johny20

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by johny20

  1. OK, so the main page looks like this (I put the scripts two times) :

    <!DOCTYPE html><html class="no-js"><title>Animals</title> <link rel="stylesheet" href="scripts/jquery.rondell.css" type="text/css" media="all" title="Screen"><script><script src="scripts/jquery-1.9.1.min.js"></script><script>$(function(){//$('h4').live('click', function(){ // jQuery 1.3+//$(document).delegate( 'h4','click', function(){   // jQuery 1.4.3+$(document).on( 'click','h4', function(){  // jQuery 1.7+  alert($(this).html())});});</script><script src="scripts/modernizr-2.0.6.min.js"></script><script src="scripts/jquery.rondell.js"></script>  <script src="fromforum.js"></script><script>function loadXMLDoc(){var xmlhttp;if (window.XMLHttpRequest)  {  xmlhttp=new XMLHttpRequest();  }xmlhttp.onreadystatechange=function()  {  if (xmlhttp.readyState==4)    {    document.getElementById("rondellCarousel").innerHTML=xmlhttp.responseText;    }  }  xmlhttp.open("GET","second.html",false);xmlhttp.send();}</script></head><body> <a href = "#" onClick = "loadXMLDoc();">Αnimals</a><br /> <br /><a href = '#' >Cars</a><div id = "rondellCarousel" class = "false"></div> <script src="scripts/jquery-1.9.1.min.js"></script> <script src="scripts/jquery.rondell.js"></script> <script src="fromforum.js"></script></body></html>

    But again nothing works. I also removed the scripts from the bottom and I placed them again but nothing new...

    The second page is as you mentioned above!

  2. Hi again. Thanks so much that help me.

    OK, look what I did (main/first) page:

    <html><head><title>Animals</title><script src="scripts/jquery-1.9.1.min.js"></script><script src="scripts/modernizr-2.0.6.min.js"></script><script>$(function(){//$('h4').live('click', function(){ // jQuery 1.3+//$(document).delegate( 'h4','click', function(){   // jQuery 1.4.3+$(document).on( 'click','h4', function(){  // jQuery 1.7+  alert($(this).html())});});</script> <link rel="stylesheet" href="scripts/jquery.rondell.css" type="text/css" media="all" title="Screen"><script>function loadXMLDoc(){var xmlhttp;if (window.XMLHttpRequest)  {  xmlhttp=new XMLHttpRequest();  }xmlhttp.onreadystatechange=function()  {  if (xmlhttp.readyState==4)    {    document.getElementById("rondellCarousel").innerHTML=xmlhttp.responseText;    }  }  xmlhttp.open("GET","second.html",false);xmlhttp.send();}</script></head><body> <a href = "#" onClick = "loadXMLDoc();">Αnimals</a><br /> <br /><a href = '#' >Cars</a><div id = "rondellCarousel" class = "false"></div> <script src="scripts/jquery-1.9.1.min.js"></script>    <script src="scripts/jquery.rondell.js"></script>  <script src="fromforum.js"></script></body></html>

    So, the second page is like this:

    <!DOCTYPE html><html class="no-js">  <head><!--    <link rel="stylesheet" href="../examples/screen.css" type="text/css" media="all" title="Screen"> --> <!-- <link rel="stylesheet" href="scripts/jquery.rondell.css" type="text/css" media="all" title="Screen"> --><!--    <script src="scripts/modernizr-2.0.6.min.js"></script> -->    <title></title>  </head>  <body>    <br> <!--     <div id="rondellCarousel" class="hidden"> --> <a target="_blank" rel="rondell_1" href="images/band.jpg" title="My favourite band"> <img src="images/band_small.jpg" alt="Band" title="My favourite band">          <h5>Awesome concert</h5>          <p>My favourite band.</p></a><a target="_blank" rel="rondell_1" href="images/dog.jpg" title="My dog"><img src="images/dog_small.jpg" alt="Dog" title="My dog">          <h5>My dog</h5>          <p>Standing in front of a glass door and wants in.</p></a><a target="_blank" rel="rondell_1" href="images/cat.jpg" title="My cat"><img src="images/cat_small.jpg" alt="Cat" title="My cat">          <h5>My cat</h5>          <p>Sleeping...</p></a><a target="_blank" rel="rondell_1" href="images/boar.jpg" title="Boar"><img src="images/boar_small.jpg" alt="Boar" title="Boar">          <h5>Dead boar on the wall</h5>          <p>Hanging around.</p></a><a target="_blank" rel="rondell_1" href="images/snow.jpg" title="Snow"><img src="images/snow_small.jpg" alt="Snow" title="Snow">          <h5>Winter wonderland</h5>          <p>The german alps.</p></a><a target="_blank" rel="rondell_1" href="images/rabbit.jpg" title="Rabbit"><img src="images/rabbit_small.jpg" alt="Rabbit" title="Rabbit">          <h5>Bunny</h5>          <p>In my brothers garden.</p></a><a target="_blank" rel="rondell_1" href="images/trash.jpg" title=""><img src="images/trash_small.jpg" alt="Trash" title="Trash">          <h5>Trash</h5>          <p>Somewhere in the USA.</p></a><h4>Click me to show alert</h4><!-- </div> --><!--    <script src="scripts/jquery-1.9.1.min.js"></script> --><!--    <script src="scripts/jquery.rondell.js"></script>  -->  </body></html>

    and the external JS (fromforum.js) file is like this:

    (function() {  $(function() {    var carousel;    carousel = $("#rondellCarousel > *").rondell({      preset: "carousel"    });    //$(".resize-button").on(function(e) {$(document).on( 'click','.resize-button', function(e){      e.preventDefault();      return carousel.fitToContainer();    });    return $.ajax({      //url: "http://www.wookmark.com/api/json",      dataType: "jsonp",      success: function(data, text, xhqr) {        var item, rondellContent, _i, _len, _ref;        if (text === "success") {          rondellContent = "";          _ref = data.slice(0, 25);          for (_i = 0, _len = _ref.length; _i < _len; _i++) {            item = _ref[_i];            rondellContent += "            <a href="" + item.image + "" title="" + item.title + " @ " + item.url + "" target="_blank" style="display:none">              <img src="" + item.preview + "" title="" + item.title + "" width="" + item.width + "" height="" + item.height + ""/>            </a>          ";          }          return $("#rondellCubic").html(rondellContent).children().rondell({            preset: "cubic"          });        }      }    });  });}).call(this);

    When I click on the <h4>, I get the alert. But nothing works again.

    Is the order of the scripts wrong?

    When I run it on IE I get an error -> Syntax error filename.html line:1 char:1 code:0

    and when I click the 'Animals' link I do not get any other error.

  3. Hi, thanks for the reply.

    I linked the jQuery inside my main file :

    <script src="scripts/jquery-1.9.1.min.js"></script>

    then I changed the click() to live(), but I thought that this has to do with the prev/next buttons at the image viewer.

    Nothing worked again...

    Yes, I want to retrieve that specific <div> and I can't understand why since it works on the second page, it can't work on the main one.. :mellow:

  4. Hi,

     

    I have two pages. The first page has two links, when a user clicks on one of them then s/he can view some information.

    I have used an image viewer taken from http://projects.sebastianhelzle.net/jquery.rondell/examples/carousel.html and I have set it according to my needs.

    the code of the first/main page is:

    <html><head><title>Animals</title><script>function loadXMLDoc(){var xmlhttp;if (window.XMLHttpRequest)  {  xmlhttp=new XMLHttpRequest();  }xmlhttp.onreadystatechange=function()  {  if (xmlhttp.readyState==4)    {    document.getElementById("rondellCarousel").innerHTML=xmlhttp.responseText;    }  }  xmlhttp.open("GET","second.html",false);xmlhttp.send();}</script></head><body> <a href = "#" onClick = "loadXMLDoc();">Αnimals</a><br /> <br /><a href = '#' >Cars</a><div id = "rondellCarousel" class = "false"><!-- I expect to see the image viewer here :/ --></div></body></html>

    The code of the second page is:

    <!DOCTYPE html><html class="no-js">  <head> <link rel="stylesheet" href="scripts/jquery.rondell.css" type="text/css" media="all" title="Screen">    <script src="scripts/modernizr-2.0.6.min.js"></script>    <title></title>  </head>  <body>    <br>      <div id="rondellCarousel" class="hidden"> <a target="_blank" rel="rondell_1" href="images/band.jpg" title="My favourite band"> <img src="images/band_small.jpg" alt="Band" title="My favourite band">          <h5>Awesome concert</h5>          <p>My favourite band.</p></a><a target="_blank" rel="rondell_1" href="images/dog.jpg" title="My dog"><img src="images/dog_small.jpg" alt="Dog" title="My dog">          <h5>My dog</h5>          <p>Standing in front of a glass door and wants in.</p></a><a target="_blank" rel="rondell_1" href="images/cat.jpg" title="My cat"><img src="images/cat_small.jpg" alt="Cat" title="My cat">          <h5>My cat</h5>          <p>Sleeping...</p></a><a target="_blank" rel="rondell_1" href="images/boar.jpg" title="Boar"><img src="images/boar_small.jpg" alt="Boar" title="Boar">          <h5>Dead boar on the wall</h5>          <p>Hanging around.</p></a><a target="_blank" rel="rondell_1" href="images/snow.jpg" title="Snow"><img src="images/snow_small.jpg" alt="Snow" title="Snow">          <h5>Winter wonderland</h5>          <p>The german alps.</p></a><a target="_blank" rel="rondell_1" href="images/rabbit.jpg" title="Rabbit"><img src="images/rabbit_small.jpg" alt="Rabbit" title="Rabbit">          <h5>Bunny</h5>          <p>In my brothers garden.</p></a><a target="_blank" rel="rondell_1" href="images/trash.jpg" title=""><img src="images/trash_small.jpg" alt="Trash" title="Trash">          <h5>Trash</h5>          <p>Somewhere in the USA.</p></a></div>    <script src="scripts/jquery-1.9.1.min.js"></script>    <script src="scripts/jquery.rondell.js"></script> <script type="text/javascript">(function() {  $(function() {    var carousel;    carousel = $("#rondellCarousel > *").rondell({      preset: "carousel"    });    $(".resize-button").click(function(e) {      e.preventDefault();      return carousel.fitToContainer();    });    return $.ajax({      url: "http://www.wookmark.com/api/json",      dataType: "jsonp",      success: function(data, text, xhqr) {        var item, rondellContent, _i, _len, _ref;        if (text === "success") {          rondellContent = "";          _ref = data.slice(0, 25);          for (_i = 0, _len = _ref.length; _i < _len; _i++) {            item = _ref[_i];            rondellContent += "            <a href="" + item.image + "" title="" + item.title + " @ " + item.url + "" target="_blank" style="display:none">              <img src="" + item.preview + "" title="" + item.title + "" width="" + item.width + "" height="" + item.height + ""/>            </a>          ";          }          return $("#rondellCubic").html(rondellContent).children().rondell({            preset: "cubic"          });        }      }    });  });}).call(this);</script>  </body></html>

    The problem is that, even if Ajax works without getting any problem, the pictures are not presented like a "carousel image viewer". If I put directly the second page in the address bar and browse it, I see the images as I wish (like a carousel image viewer with next/prev arrows).

     

    Can anyone help with that?

    Thank you in advance.

  5. Hello,

    I can't get data from mysql when I put Greek characters in SELECT statement.

    require_once(dirname(__FILE__).'etc etc etc etc');$mysqli->query("utf8_general_ci"); // I have tried "UTF8" - Didn't work$query =  "SELECT * FROM graf WHERE onoma LIKE 'ΓΕ%' ";$mysqli->query("SET CHARACTER SET 'utf8_general_ci'");$result = mysqli_query($mysqli,$query);if ($result !=0){ while ($row = mysqli_fetch_assoc($result))  {  	  echo $row['onoma']; } }echo mysqli_error($mysqli); //gives no errorecho mysqli_sqlstate($mysqli); //gives 00000 which means the statement is correct 

    Also, in MySQL the collation is 'utf_general_ci' for each row.

    If I do a "select * from graf" I get the data without any encoding problem.

    Any ideas please?

  6. I use the email() function in order to send emails to the users of my system. The problem is that when they receive the email, they see something like this: myUserName@the_servername.com [myUsername@the_servername.com] on behalf of Web Master [webmaster@mydomain.com]myUsername is the username I use to log-in on Cpanel! How I can avoid all these and keep only the part after the "on behalf"? the code I have so far:

    $message = "mplampla";$headers = 'Bcc:' .$email. "\r\n";$headers .= 'From: Web Master <webmaster@mydomain>'."\r\n";  //I want only thismail('',"Invitation",$message,"$headers");

    The $email is specified by me, using a text field.

×
×
  • Create New...