SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 29 of 29
  1. #26
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, so if i have multiple class in tr,it should like this

    <tr class="firstclass secondclass">
    //some code here
    </tr>
    what about other scenario maybe this also can be the cause why my script did not work...when i navigate other page i just use .load() function and in my url it will never change it always firstpage.php but in the body is now the content of secondpage.php,now does all my javascript in secondpage will work?

    I hope you get my point.Thank you in advance.

  2. #27
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,355
    Mentioned
    179 Post(s)
    Tagged
    9 Thread(s)
    Yes to your first question, that is correct.
    Regarding point two, it is difficult to say without seeing an example.

  3. #28
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi pullo.,,what do you mean point two?is that talking two class in one tr?,...

    it is difficult to say without seeing an example.
    Okay i will write back as soon as i can to give an example what i mean in .load() function

  4. #29
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,355
    Mentioned
    179 Post(s)
    Tagged
    9 Thread(s)
    Sorry if I was unclear before.
    Let me explain:

    Multiple classes on an element should look like this:

    HTML Code:
    <tr class="firstclass secondclass thirdclass fourthclass">
      //some code here
    </tr>
    They should be separated with a space and you can have as many as you want (within reason).

    Quote Originally Posted by jemz View Post
    when i navigate other page i just use .load() function and in my url it will never change it always firstpage.php but in the body is now the content of secondpage.php, now does all my javascript in secondpage will work?
    My initial answer would be no.
    For example:

    File 1:
    HTML Code:
    <!DOCTYPE HTML>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>.load() example</title>
        <script src="http://code.jquery.com/jquery-latest.js"></script>
      </head>
      <body>
        <dv id="result"></div>
         
        <script>
          $('#result').load('test.html #container');
        </script>
      </body>
    </html>
    File 2:
    HTML Code:
    <!DOCTYPE HTML>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Unbenanntes Dokument</title>
      </head>
      
      <body>
      <div id="container">
        <h1>Some content</h1>
        <script>alert("bo");</script>
        <h2>Some more content</h2>
        </div>
      </body>
    </html>
    Here, file 1 loads file 2 via .load()
    On load however, you will not see an alert box pop up, as the script tags will not be inserted into file 1.
    Maybe there is a way to accomplish what you are trying to do.
    I would just need to see a (minimal) example.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •