2009-07-02 2 views
0

Я пытаюсь интегрировать эффект слайдов js slideshow с php. Он работал нормально, но не больше, я не уверен, что изменилось. Теперь он показывает предупреждение, в котором говорится: «Не найдено содержимого». Соединение с базой данных должно быть в порядке, содержимое отображается в других областях страницы.php внутри javascript - Содержание не найдено

Любые идеи, в которых я ошибся?

<script type='text/javascript'> 
    $(function() { 
     $("#blogSlider").codaSlider(); 
    }); 
</script> 
</head> 

<body> 
<div class="navheader"> 
</div> 

<div class="header2"><p class="headlineblack"> 

<?php 
    $result = mysql_query("SELECT * FROM Home", $connection); 
    if (!$result) { 
     die("Database query failed: " . mysql_error()); 
    } 

    while ($row = mysql_fetch_array($result)) { 
     echo $row["blurb"]; 
    } 
?> 
</p> 
    </div> 

<div class="container"> 
    <p class="subheadgrey"><img src="images/grafix_down_small.png" width="30" height="22" /> Case studies</p> 
    </div> 


<div class="container"> 
<script type="text/javascript"> 

var slsContents = new Array(); 

          <?php 

$query = "SELECT * FROM studies"; 
$result = mysql_query($query, $connection) or trigger_error("SQL", E_USER_ERROR); 


$query_data = mysql_fetch_row($result); 
$numrows = $query_data[0]; 


$num=mysql_numrows($result); 

$i=0; 
while ($i < $num) { 

$id=mysql_result($result,$i,"id"); 
$title=mysql_result($result,$i,"title"); 
$strategies=mysql_result($result,$i,"strategies"); 
$client=mysql_result($result,$i,"client"); 
$copy=mysql_result($result,$i,"copy"); 
$thumbmedia=mysql_result($result,$i,"thumbmedia"); 
$niche=mysql_result($result,$i,"niche"); 

echo 'slsContents['.$id.'] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id='.$id.'\">'.$title.'</a></p></div><div class=\"containerstudy\">" +'; 
echo         '"<div class=\"column1\">" +'; 
echo         ' "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">'.$strategies.'</p>" +'; 
echo         '"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +'; 
echo         '"<p class=\"subheadsmall\">Client</p>" +'; 
echo         '"<p class=\"sidebargrey\">'.$client.'</p>" +'; 
echo         '"</div>"+'; 
echo        '"<div class=\"column2\">" +'; 
echo         '"<p class=\"bodygrey\">'.substr($copy, 0, 300).'<a href=\"casestudy.php?id='.$id.'\">...more</a></p>" +'; 
echo        '"</div>" +'; 
echo         '"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";'; 


$i++; 
} 

?> 
</script> 

<script type="text/javascript" src="slideshow/slideshow.js"></script> 


         </div> 
        </div> 

** Редакцией: это то, что приходит в источнике:

<script type="text/javascript"> 

var slsContents = new Array(); 

          slsContents[1] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=1\">man</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"><a href="strategies.php?strategy=Asking_a_question_when_you_already_know_the_answer">Asking a question when you already know the answer</a></p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">NZTrio</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">ftyiuutf<a href=\"casestudy.php?id=1\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[2] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=2\"></a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"></p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">Select a Client...</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\"><a href=\"casestudy.php?id=2\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[3] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=3\">title three</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">and this one too</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">client c</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">today qw we wnt to the resene tshoep and sdurkngk some salcohol and anoe i'm kinkdo of drunk and alluan uwnat ts met ot do wealy data wentyr and i can't trnkdyfp<a href=\"casestudy.php?id=3\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[4] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=4\">title four</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">client d</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">Despite international critical acclaim and rave reviews, NZ Trio's concerts just weren't pulling in the crowds. 4i's helped the trio identify a more promising niche market and repackage its product offering to appeal directly to the new audience. The turnaround marketing strategy, which employed a n<a href=\"casestudy.php?id=4\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[5] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=5\">title five</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">and this one too</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">client e</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">today qw we wnt to the resene tshoep and sdurkngk some salcohol and anoe i'm kinkdo of drunk and alluan uwnat ts met ot do wealy data wentyr and i can't trnkdyfp<a href=\"casestudy.php?id=5\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[6] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=6\">Title six</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"><a href="strategies.php?strategy=Turkey_Basting">Turkey Basting</a> // <a href="strategies.php?strategy=Asking_a_question_when_you_already_know_the_answer">Asking a question when you already know the answer</a></p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">NZTrio</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">Despite international critical acclaim and rave reviews, NZ Trio's concerts just weren't pulling in the crowds. 4i's helped the trio identify a more promising niche market and repackage its product offering to appeal directly to the new audience. The turnaround marketing strategy, which employed a n<a href=\"casestudy.php?id=6\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[7] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=7\">Title seven</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">and this one too</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">client g</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">today qw we wnt to the resene tshoep and sdurkngk some salcohol and anoe i'm kinkdo of drunk and alluan uwnat ts met ot do wealy data wentyr and i can't trnkdyfp<a href=\"casestudy.php?id=7\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[9] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=9\">title nine</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">and this one too</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">client i</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">today qw we wnt to the resene tshoep and sdurkngk some salcohol and anoe i'm kinkdo of drunk and alluan uwnat ts met ot do wealy data wentyr and i can't trnkdyfp<a href=\"casestudy.php?id=9\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[10] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=10\">title ten</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">client j</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">Despite international critical acclaim and rave reviews, NZ Trio's concerts just weren't pulling in the crowds. 4i's helped the trio identify a more promising niche market and repackage its product offering to appeal directly to the new audience. The turnaround marketing strategy, which employed a n<a href=\"casestudy.php?id=10\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[11] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=11\">title eleven</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">and this one too</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">client k</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">today qw we wnt to the resene tshoep and sdurkngk some salcohol and anoe i'm kinkdo of drunk and alluan uwnat ts met ot do wealy data wentyr and i can't trnkdyfp<a href=\"casestudy.php?id=11\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[12] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=12\">Title twelve</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">Client l</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">Despite international critical acclaim and rave reviews, NZ Trio's concerts just weren't pulling in the crowds. 4i's helped the trio identify a more promising niche market and repackage its product offering to appeal directly to the new audience. The turnaround marketing strategy, which employed a n<a href=\"casestudy.php?id=12\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[13] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=13\">Title thirteen</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">and this one too</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">client m</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">today qw we wnt to the resene tshoep and sdurkngk some salcohol and anoe i'm kinkdo of drunk and alluan uwnat ts met ot do wealy data wentyr and i can't trnkdyfp<a href=\"casestudy.php?id=13\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[15] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=15\">Title fifteen</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">and this one too</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">Client o</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">today qw we wnt to the resene tshoep and sdurkngk some salcohol and anoe i'm kinkdo of drunk and alluan uwnat ts met ot do wealy data wentyr and i can't trnkdyfp<a href=\"casestudy.php?id=15\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[16] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=16\">Title sixteen</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">client p</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">Despite international critical acclaim and rave reviews, NZ Trio's concerts just weren't pulling in the crowds. 4i's helped the trio identify a more promising niche market and repackage its product offering to appeal directly to the new audience. The turnaround marketing strategy, which employed a n<a href=\"casestudy.php?id=16\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[17] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=17\">title seventeen</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">and this one too</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">client q</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">today qw we wnt to the resene tshoep and sdurkngk some salcohol and anoe i'm kinkdo of drunk and alluan uwnat ts met ot do wealy data wentyr and i can't trnkdyfp<a href=\"casestudy.php?id=17\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[18] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=18\">fghj</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"></p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">empty</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">lk'dfx<a href=\"casestudy.php?id=18\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[19] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=19\">evry time</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\">hmm</p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">Gary Busey</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">why don't it<a href=\"casestudy.php?id=19\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[20] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=20\">fdgh</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"></p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">Gary Busey</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">sfgh<a href=\"casestudy.php?id=20\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[21] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=21\">mr</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"></p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">Gary Busey</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">xsdfgh<a href=\"casestudy.php?id=21\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[22] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=22\">fgj</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"></p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">empty</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">fdghj<a href=\"casestudy.php?id=22\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[23] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=23\"></a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"></p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">empty</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\"><a href=\"casestudy.php?id=23\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[24] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=24\">dfg</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"></p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">empty</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">sdfg<a href=\"casestudy.php?id=24\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[25] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=25\">ghjk</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"></p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">empty</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\"><a href=\"casestudy.php?id=25\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";slsContents[26] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=26\">fudget</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"></p>" +"<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">empty</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\"><a href=\"casestudy.php?id=26\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>";</script> 

С новыми изменениями, это новый источник:

var slsContents = new Array(); 

          slsContents[28] = "<div class=\"container\"><p class=\"subheadred\"><a href=\"casestudy.php?id=28\">If we needed proof that enthusiasm is infectious...</a></p></div><div class=\"containerstudy\">" +"<div class=\"column1\">" + "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"><a href=\"strategies.php?strategy= 
Viral_marketing\"> 
Viral marketing</a></p>" +"<p class=\"subheadsmall\">Client</p>" +"<p class=\"sidebargrey\">empty</p>" +"</div>"+"<div class=\"column2\">" +"<p class=\"bodygrey\">Approaching the close-off of applications for post-graduate study positions for the year, The University of Auckland’s National Institute of Creative Arts & Industries (NICAI) still had some places to fill.<br /> 
<br /> 
While the problem was essentially one of lead generation, the number of ca<a href=\"casestudy.php?id=28\">...more</a></p>" +"</div>" +"<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>"; 
+1

Некоторые основные способы устранения неполадок. Посмотрите источник просмотра в браузере? – Clay

+0

см. Править выше - спасибо. Итак, он получает контент из базы данных, просто не отображая почему-то – user96828

ответ

1

Это выглядит проблема с вашим сгенерированным JavaScript, если вы посмотрите на строку ниже, вы увидите, что в ней есть href без экранированного.

на 5-й строке кода ниже у вас есть

<a href="strategies.php?strategy=Asking_a_question_when_you_already_know_the_answer"> 

Это выглядит, приходит из базы данных, и сортируются в $ стратегий вар, я хотел бы предложить вам сделать str_replace на всех выходе из базы данных, чтобы заменить "с \"

как так

$strategies = str_replace ('"', '\\"' , $strategies); 

код с выхода

slsContents[1] = "<div class=\"container\"><p class=\"subheadred\"> 
        <a href=\"casestudy.php?id=1\">man</a></p></div> 
        <div class=\"containerstudy\">" +"<div class=\"column1\">" + 
       "<p class=\"subheadsmall\">Strategies</p><p class=\"sidebarred\"> 
       <a href="strategies.php?strategy=Asking_a_question_when_you_already_know_the_answer"> 
       Asking a question when you already know the answer</a></p>" + 
       "<p class=\"sidebargrey\"><a href=\"link\">Target market segmentation // marketing strategy and execution</a></p>" + 
       "<p class=\"subheadsmall\">Client</p>" + 
       "<p class=\"sidebargrey\">NZTrio</p>" +"</div>"+ 
       "<div class=\"column2\">" + 
       "<p class=\"bodygrey\">ftyiuutf<a href=\"casestudy.php?id=1\">...more</a></p>" + 
       "</div>" + 
       "<div class=\"column3\"><img src=\"images/tn_tereoposter.jpg\" width=\"275\" height=\"160\" /></div></div>"; 
+0

Невероятно! это замечательно. Он отлично работает на моем компьютере, но он все еще говорит то же самое на моем хост-сервере. есть идеи? Я отредактировал новый источник в вопросе выше – user96828

Смежные вопросы