Hi,

I think there is no need to use eval(); function. I'm not sure if this
works but i would do it like that:

function requestCustomerInfo() {
        var sId = $("input#includi").val();
        $("div#divCustomerInfo").load("page_b.php?query=" + sId,
FunctionFromBPage());  //or $("div#divCustomerInfo").load
("page_b.php", {query: sId}, FunctionFromBPage());
}

------------------------page b javascript code------------------------
<script type="text/javascript">
        function FunctionFromBPage(){
                new LinkedIn.CompanyInsiderPopup("li<?=$fld [\"id\"];?
>","Microsoft");
        }
</script>

On 15 Lis, 16:03, Pofferbacco <luca.libon...@gmail.com> wrote:
> Hello,
> I need your help to solve an issue.
>
> I have:
> - page a: a page with a form
> - page b: a php page that output a result after a query to the
> database
>
> I use ajax to do the request to page b and I display the result in
> page a.
> Inside the output there is a javascript script that is not displayed
> in page a after the search.
> I know I have to use eval to let the script work, but I don't know
> where, since jquery (and javascript) is really new for me
>
> Inside page a I have the following code:
>
> <script type="text/javascript" src="./js/jquery.js"></script>
> <script src="http://www.linkedin.com/companyInsider?
> script&useBorder=yes" type="text/javascript"></script>
>  <script type="text/javascript">
> //<![CDATA[
> function requestCustomerInfo() {
>         var sId = $("input#includi").val();
>         $.get("page_b.php?query=" + sId, displayCustomerInfo);
>
> }
>
> function displayCustomerInfo(sText, sStatus) {
>         if (sStatus == "success") {
>                 $("div#divCustomerInfo").html(sText);
>         } else {
>                 $("div#divCustomerInfo").html("An error occurred.");
>         }}
>
> //]]>
> </script>
>
> Inside the output of page b I have this script:
>
> <div class="brown-bg"><span id="li<?=$fld["id"];?>" style=" padding-
> left:30px;"></span></div>
>                 <script type="text/javascript">
>                          new LinkedIn.CompanyInsiderPopup("li<?=$fld
> ["id"];?>","Microsoft");
>                       </script>
>
> This script is not displayed in page a.
> Where do I have to use eval in order to let this script works??
>
> Thank you.
> Luca

Reply via email to