JS 对象引用地址问题处理

news/2024/7/19 15:20:47 标签: js
  1. 赋值新数组引用地址相同,改变了原数组问题。
	Object.assign({}, _This.data.data) 
  1. item 为dom对象 该传值方式解决for循环中调用ajax始终传入最后一个值的问题
    function getYHTypeList(BOOSTERIDS, item, callBack) {
                // 发送ajax请求
                //找到有效调压箱编号OLDNO1
                var GetUserInfoOpt = {
                    url: $$.gisGlobal.getConfiguration() + "/GZ_UserTypeCount?ticket=" + $$.gisGlobal.getTicket(),
                    //url: "DevelopmentCase/Analysis/Analysis_GZJSON.json",
                    data: '{"boxIds":"' + BOOSTERIDS.join(",") + '"}',
                    value: item
                }
                $$.ajax(GetUserInfoOpt, function(res, value) {

                    if (res == "操作失败") {
                        if (callBack) {
                            return callBack(false);
                        }
                    }

                    if (res.GZ_UserTypeCountResult) {
                        res = res.GZ_UserTypeCountResult
                    }
                    var r = eval('(' + res + ')');

                    if (callBack) {
                        callBack(r, item);
                    }
                })

            }

http://www.niftyadmin.cn/n/763337.html

相关文章

JAVA-在IDEA中使用MyBatis Generator生成实体类和mapper配置文件

在idea中集成了MyBatis Generator的功能&#xff0c;下面介绍需要怎么使用这个插件。 1、在pom.xml文件的build节点加上以下代码 <!-- mybatis generator 自动生成代码插件 --> <plugin> <groupId>org.mybatis.generator</groupId> <artifactId&g…

TOMCAT-部署项目-tomcat 不能多启动问题解决方案

tomcat 不能多启动问题 解决方案&#xff1a; 更改tomcat server.xml 所有涉及端口 8089 端口&#xff1a;8005 8089 8443 8009 8088 端口&#xff1a;8006 8088 8444 8010

TOMCAT-解决多个Spring Boot项目部署在一个Tomcat容器冲突问题

Spring Boot的spring.jmx资源管理是默认打开的&#xff0c;而两个项目同时使用会冲突 修改配置文件&#xff1a;application.properties(yml) 办法1&#xff1a; 在项目配置中加入&#xff1a;spring.jmx.enabledfalse 办法2&#xff1a; 在application中各自配置 spring.jmx.…

JAVA-使用Thumbnails压缩图片

使用Thumbnails压缩图片 <!-- https://mvnrepository.com/artifact/net.coobird/thumbnailator 压缩图片插件--> <dependency> <groupId>net.coobird</groupId> <artifactId>thumbnailator</artifactId> <version>0.4.8</versio…

C#-后端HTTP请求两种方式GET POST

C#后端HTTP请求两种方式GET POST GET方式 public static object GetToJson(string url){string JsonStr "";HttpWebRequest req (HttpWebRequest)WebRequest.Create(url);req.AllowAutoRedirect true;HttpWebResponse res (HttpWebResponse)req.GetResponse();S…

C# 一般处理程序

C#一般处理程序 <% WebHandler Language"C#" Class"GetWaterUser" %>using System.Web; using System.Data; using System.Text; using System.Data.SqlClient;public class GetWaterUser : IHttpHandler {public void ProcessRequest(HttpContext …

Oracle11g安装教程

1.解压缩文件 2.打开文件夹&#xff0c;双击运行setup.exe 3.一直下一步&#xff0c;等待 4.口令管理 5.完成

【配置】Win10下 Java环境变量配置

首先&#xff0c;你应该已经安装了 Java 的 JDK 了&#xff08;如果没有安装JDK&#xff0c;请跳转到此网址&#xff1a;http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html&#xff09; 笔者安装的是 jdk-8u91-windows-x64 接下来主要讲怎么配…