Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created Wcf Service and this output like this

[{"id":"AD","name":"Andorra"},{"id":"AE","name":"United Arab Emirates"},{"id":"AF","name":"Afghanistan"},{"id":"AG","name":"Antigua And Barbuda"},{"id":"AI","name":"Anguilla"},{"id":"AL","name":"Albania"},{"id":"AM","name":"Armenia"},{"id":"AN","name":"Netherland Antilles"},{"id":"AO","name":"Angola"},{"id":"AQ","name":"Antartica"},{"id":"AR","name":"Argentina"},{"id":"AS","name":"Samoa, American"},{"id":"AT","name":"Austria"},{"id":"AU","name":"Australia"},{"id":"AW","name":"Aruba"},{"id":"AX","name":"Aland Islands"},{"id":"AZ","name":"Azerbaijan"},{"id":"BA","name":"Bosnia Herzegovina"},{"id":"BB","name":"Barbados"},{"id":"BD","name":"Bangladesh"},{"id":"BE","name":"Belgium"},{"id":"BF","name":"Burkina Faso"}]


but when i Call it in javascript
XML
<div>
       <input type="text" id="demo-input" name="blah" />
       <input type="button" value="Submit" />
       <script type="text/javascript">
       $(document).ready(function() {
           $("#demo-input").tokenInput("http://localhost:4398/MyFirstService.svc/json/getdata");
       });
       </script>
   </div>


there is no data in input item

[EDIT]: localhost link removed
Posted
Updated 2-Sep-13 2:43am
v2

1 solution

From the code, it seems that the webservice is not getting hit when calling the TokenInput pluggin. Place a breakpoint within the method just to validate if the service is being hit.

Also, see if JavaScript debugging is turned off in the browser, as else it will throw some error if there's some issue binding the pluggin. If the pluggin is included before this binding, it can be that the pluggin's location is not correctly mapped to the virtual directory structure. Use ResoloveUrl to handle this case, if present.

If there are some errors reported after enabling the javascript debugging in the browser, please include the error details so as to help find out the cause.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900