`

Accessing Data In JSON

    博客分类:
  • ASP
阅读更多
asp from server:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#INCLUDE FILE = "check.asa"-->
<!--#INCLUDE FILE = "sub/opendb.asa"-->

<%
  project_id = request("id")

  sql = "select * from bug_project_user where role_type='hardowner' and project_id="&project_id
  set rs = db.execute(sql)
  dim_hardowner_user = rs("user_id")
  
  sql = "select * from bug_project_user where role_type='CustomerAmbassador' and project_id="&project_id
  set rs = db.execute(sql)
  CustomerAmbassador_user = rs("user_id")
  
  sql = "select * from bug_project_user where role_type='TestAmbassador' and project_id="&project_id
  set rs = db.execute(sql)
  TestAmbassador_user = rs("user_id")
  
  sql = "select * from bug_project_user where role_type='Pgttm' and project_id="&project_id
  set rs = db.execute(sql)
  Pgttm_user = rs("user_id")
  
  sql = "select * from bug_project_user where role_type='itemcharger' and project_id="&project_id
  set rs = db.execute(sql)
  itemcharger_user = rs("user_id")

 json = "msg={'hardowner':"&dim_hardowner_user&",'CustomerAmbassador_user':"&CustomerAmbassador_user&",'TestAmbassador_user':"&TestAmbassador_user&",'Pgttm_user':"&  Pgttm_user&",'itemcharger_user':"&itemcharger_user&"}"


response.Write json

 %>


asp from broswer:
<script language="JavaScript" type="text/javascript">
function choose_related_users(id){	
	$.ajax({
		  url: "choose_bug_related_users.asp?id="+id,
		  global: false,
		  type: "POST",
		  data: ({id : id}),
		  dataType: "html",
		  async:false,
		  success: function(msg){
                            // evaluate object from server
		  	eval(msg)
                              
                            // select option in <select> using jQuery
			$("#toHardProductLeader ").val(msg.hardowner); 
			$("#toCustomerAmbassador ").val(msg.CustomerAmbassador_user); 
			$("#toTestAmbassador").val(msg.TestAmbassador_user);
			$("#toPgttm").val(msg.Pgttm_user);
			$("#toPgttm").val(msg.Pgttm_user);
			$("#toitemcharger").val(msg.itemcharger_user);
		  }
	   }
	)
	return false;
}
</script>



reference:http://www.hunlock.com/blogs
分享到:
评论

相关推荐

    XML and Web Technologies for Data Sciences with R

    The XML and JSON data formats are widely used in Web services, regular Web pages and JavaScript code, and visualization formats such as SVG and KML for Google Earth and Google Maps. In addition, ...

    JavaScript and Open Data 2018 pdf

    - accessing open data, free data, combining data from multiple sources by asynchronous “join”; - displaying digital data in graphical plots, animating vector data, cartographic representation; - ...

    Beginning.Hybrid.Mobile.Application.Development.1484213

    Accessing data in hybrid application Role of JSON over XML in hybrid application Code Security This book will change the paradigm of mobile application development as the efforts are less, learning ...

    unidac_7_1_4_pro DELPHI 10 Tokyo

    JSON data type is supported InterBase data provider Support for Firebird on Android platform is added Support for Firebird 3 packages is added Aliases handling in the RETURNING clause is supported The...

    Unidac Pro 7.1.4 XE8

    JSON data type is supported InterBase data provider Support for Firebird on Android platform is added Support for Firebird 3 packages is added Aliases handling in the RETURNING clause is supported The...

    unidac_7_1_4_pro DELPHI 10 Berlin

    JSON data type is supported InterBase data provider Support for Firebird on Android platform is added Support for Firebird 3 packages is added Aliases handling in the RETURNING clause is supported The...

    UniDAC 7.1.4

    JSON data type is supported InterBase data provider Support for Firebird on Android platform is added Support for Firebird 3 packages is added Aliases handling in the RETURNING clause is supported ...

    Spring.Essentials.178398

    Develop RESTful API applications for XML and JSON data transfers with non-blocking asynchronous capabilities Explore Spring's comprehensive transaction support for declarative Transaction Management ...

    Pro MongoDB Development [2016]

    The book discusses all aspects of using MongoDB in web applications: Java, PHP, Ruby, JavaScript are the most commonly used programming/scripting languages and the book discusses accessing MongoDB ...

    Mastering Swift 4, 4th Edition-Packt Publishing(2017).pdf

    This will include accessing REST services working with JSON data and the formatting framework. Chapter 17, Adopting Design Patterns in Swift, shows you how to implement some of the more common design...

    apress.beginning.apache.cassandra.development.1484201434

    author Vivek Mishra includes complete coverage of accessing Cassandra database with these languages and developing applications sourcing data from Cassandra. An introduction to the Cassandra Query ...

    Power Query M Reference Microsoft Docs.pdf

    1. **Accessing Data Functions**:这部分函数用于从各种数据源获取数据,如`Access.Database`用于连接到Access数据库,`ActiveDirectory.Domains`用于查询Active Directory域,`AzureStorage.BlobContents`则用于从...

    Python for Bioinformatics 第二版,最新版

    8.5.1 Create a New Data Type Using a Built-in Data Type 154 8.6 MAKING OUR CODE PRIVATE 154 8.7 ADDITIONAL RESOURCES 155 8.8 SELF-EVALUATION 156 Chapter 9 Introduction to Biopython 157 9.1 WHAT IS ...

    Expert Delphi

    'JSON' 'XML' 'Summary' 4: Playing with FireMonkey 'Chapter 4: Playing with FireMonkey' 'Drawing in code' 'Get moving with timers' 'The power of parenting' 'Touch me' 'Game of Memory' 'Summary' 5: ...

    Lerner -- Python Workout. 50 Essential Exercises -- 2020.pdf

    The exercises cover various aspects of the Python programming language, including basic syntax, data structures, algorithms, and working with external formats such as CSV and JSON. #### Detailed ...

    spring-boot-reference.pdf

    20.2.1. Logging changes in condition evaluation 20.2.2. Excluding Resources 20.2.3. Watching Additional Paths 20.2.4. Disabling Restart 20.2.5. Using a Trigger File 20.2.6. Customizing the Restart ...

Global site tag (gtag.js) - Google Analytics