Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

i want to know what value passing

<script type="text/javascript">
            $(function() {

                var $countryGrid = $(".countries").grid();
                var $cityGrid = $(".cities").grid();

                $countryGrid.on("rowClick",function(event, $row, rowData) {
                console.log(rowData);
                // Value 6
                var code = rowData.Code;

                    **$cityGrid.grid("load",{
                        action: "world-ajax.php?type=city&country=" + code**
                    // I want to check what action parameter passing code value as it's show me
                      data not found but there is data. 

                    });

                });




                });



            });
        </script>

Is there any way to check this value.

share|improve this question
2  
You could simply use console.log(code) and/or check developer tools to see the request url. –  LJ_1102 1 hour ago

1 Answer 1

Use Javascript Logging

If your browser supports debugging, you can use the console.log() method to display JavaScript values in the browser.

Just add the following in script tag:

console.log(yourVarOfInterest);

Different browsers support different debugging/developer tools.

  • Safari: Install developer tools and then select Develop-> Show Web Inspector
  • Chrome: View->Developer->Javascript Console
share|improve this answer
    
Hi, I know my code value is 6 from console.log(rowData).now i want to pass this value to $cityGrid.grid("load",{ action: "world-ajax.php?type=city&country=" + code; But i am not sure what the value passing because it returns me null value but there is data. and console.log(yourVarOfInterest) yourVarOfInterest is keyword or i set my variable and in script where i should use this –  Ahsan Kabir Chowdhury 56 mins ago
    
Hi, i find now when i try find $countryGrid.on("rowClick",function(event, $row, rowData) { var code = rowData.Code; console.log(code); it's give me undefined but if i use console.log(rowData) then it show me 6. So i think there is problem to declare my variable. Please check is there any mistake to declare variable –  Ahsan Kabir Chowdhury 47 mins ago
    
If your rowData.Code value is correct your path to world-ajax.php is wrong maybe try prepend it with / so it becomes absolute. And no unfortunately yourVarOfInterest is not a keyword but meant to be replaced by your variable of interest. –  LJ_1102 46 mins ago
    
If console.log(rowData) gives you 6 as output then it has no Code property but already is the code you're looking for. –  LJ_1102 45 mins ago
    
Hi, i find if i use code= rowdata instead of code=rowdata.code then it's show me my value in console. so now i want to know why these value not passing –  Ahsan Kabir Chowdhury 43 mins ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.