当前位置: 首页 > 编程日记 > 正文

js 跨页面的全局变量

定义全局变量的js: a.js

1 function GlobalConfig(){
2 
3 }
4 GlobalConfig.IPSSAddress="http://localhost/index/";
5 (function(){
6 
7 })();
View Code

页面index.html里需要引用a.js

页面index.html自己的js: b.js

$scope.URL = GlobalConfig.IPSSAddress;

转载于:https://www.cnblogs.com/miny-simp/p/7489791.html

相关文章:

微信小程序发送表情

实现代码: 先在data定义两个数组,分别是表情和存表情正则替换的符号表示 connectemoji: [😊, 😅, 😲, 😭, 😂, 😄, 😩, 😞, 😵, 😒, …

CSS-in-JS的权衡

by Oleg Isonen由Oleg Isonen CSS-in-JS的权衡 (The tradeoffs of CSS-in-JS) Recently I wrote a higher level overview of CSS-in-JS, mostly talking about the problems this approach is trying to solve. Library authors rarely invest time into describing the trad…

抽象工厂模式AbstractFactory

简介 抽象工厂模式(Abstract Factory Pattern):提供一个创建一系列相关或相互依赖对象的接口,而无须指定它们具体的类。抽象工厂模式又称为Kit模式,属于对象创建型模式。 不同点 为了更清晰地理解抽象工厂模式,需要先引入两个概念…

uni-app 之 使用扩展组件(uni ui) Pagination 分页器使用示例

先贴出 分页器文档的地址: Pagination 分页器 使用步骤: 1.下载或者导入插件到你的项目; 2.在需要使用的页面引入该插件。 使用操作: 1.下载或者导入插件到你的项目; 导入的操作流程示例图: 点击使用…

S3C2440-中断体系架构

1.ARM的体系与架构 1.1.ARM体系的CPU有以下其中工作模式: 用户模式 (usr)快速中断模式 (fiq) 中断模式 (irq)管理模式 (svc)数据访问终止模式 (abt)系统模式 (sys)未定义指令终止模式 (und)1.2.ARM寄存器: 31个通用寄存器 : R0~R7(未备份寄存器) , R8~R14(备份寄存器) , R15( …

编码和编码格式一样吗?_学习如何像专业人士一样编码

编码和编码格式一样吗?Learn how to write more professional code from Dylan Israel. Dylan teaches about tools and principles to improve your code that hes found helpful in his job as a developer.从Dylan Israel了解如何编写更专业的代码。 Dylan教授有关改善您的…

__bridge 使用注意

前奏 在平常开发中,我们可能遇到 CoreFoundation(CF) 框架的对象和 OC 对象之间的类型转换,这时候我们需要 __bridge 来帮忙 注意 : 如果是使用 CF __bridge CF -> OC (只完成类型转换)- (void)bridgeCF2OC{CFStringRef aCFString CFStringCreateWithCString(NULL, "b…

php使用TCPDF生成PDF文件教程

functioncreatePdfFile($frontData) { /*新建一个pdf文件: Orientation:orientation属性用来设置文档打印格式是“Portrait”还是“Landscape”。 Landscape为横式打印,Portrait为纵向打印 Unit:设置页面的单位。pt:点…

VUE 框架添加全局公共方法 , 保留小数点后两位

在main.js 里面给Vue对象添加方法。 来一个示例代码: import Vue from vue import App from ./AppVue.prototype.num_to_str_liangwei (val 0) > {return (val / 100).toFixed(2) } App.mpType appconst app new Vue({...App }) app.$mount() 代码添加的…

在Unity中创建3D直升机游戏

In this lecture from Colton Ogden, you can learn game development principles by coding a Helicopter Game 3D using Unity and C#. The principles you learn can apply to any programming language and any game.在Colton Ogden的本次演讲中,您可以通过使用…

洛谷P3572 [POI2014]PTA-Little Bird

P3572 [POI2014]PTA-Little Bird 题目描述 In the Byteotian Line Forest there are nn trees in a row. On top of the first one, there is a little bird who would like to fly over to the top of the last tree. Being in fact very little, the bird might lack the str…

ps aux详解(进程状态说明)

linux上进程有5种状态: 1. 运行(正在运行或在运行队列中等待) 2. 中断(休眠中, 受阻, 在等待某个条件的形成或接受到信号) 3. 不可中断(收到信号不唤醒和不可运行, 进程必须等待直到有中断发生) 4. 僵死(进程已终止, 但进程描述符存在, 直到父进程调用wait4()系统调用后释放) 5…

小程序云开发 一开通云开发,给数据库添加一条记录

先来一个给云数据库添加一条数据库记录的代码: wx.cloud.init({env:school-5k07l})const db wx.cloud.database()const school db.collection(school_db)//school_db是数据库记录的名称,相当于MYSQL中数据库的表的名字school.add({// data 字段表示需新…

spring vertx_如何在Spring设置Vertx

spring vertxby Rick Lee李瑞克(Rick Lee) 如何在Spring设置Vertx (How to set up Vertx in Spring) Spring is probably the most popular framework in the Java space. We all love its dependency injection and all that autowired/configuration magic. It makes unit t…

-lt -gt -ge -le -eq的意义

脚本如下:#!/bin/bashx0while [ $x -lt 10 ]doecho $xxecho "$x1" | bcdone请问这里的-lt是什么意思,请大家指点一二,谢谢。 -lt less than 小于-gt great than 大于-ge great equal 大于等于-le less equal 小于等于-eq equal…

elasticsearch5.5.2环境搭建

运行elasticsearch5.5.2需要jdk1.8版本以上 1.elasticsearch可以去官网或github下载,window系统推荐zip压缩版 2.解压后 进入bin目录运行elasticsearch.bat启动服务 3.访问localhost:9500测试是否成功 4.安装中文分词插件:https://github.com/medcl/elas…

React useState,useEffect ,Hook是什么?什么是副作用?

初步接触 React 中的同学可能会对 useState,useEffect ,Hook,副作用 这些命名比较陌生,一起来了解一下。 Hook是什么? Hook 是钩子,我理解他是一个概念,在不使用class(使用函数)定义一个组件的时候,能用到一些 React 的钩子函数;React 内置了一些像 useState 这样…

塞尔达传说顺序_编码《塞尔达传说》克隆图例

塞尔达传说顺序In this lecture from Colton Ogden, you can learn game development principles by coding a classic Legend of Zelda clone in Lua. The principles you learn can apply to any programming language and any game.在科尔顿奥格登(Colton Ogden)的演讲中&am…

Scrum卡片层次图

对照国内的项目管理软件禅道,可以好好感受一下,何为Scrum。 看板则一定要是实物,才有感觉。 转载于:https://www.cnblogs.com/x3d/p/7500801.html

Linux 中打开tomcat的startup.sh 没有显示successed的方法。

网上下载了tomcat的压缩包,解压到home目录下,然后进入到bin目录下,输入./startup.sh 下面显示如下: 并没有显示successed,但是实际上已经成功启动了tomcat。 去网页上,输入地址、端口号就可以看到tomcat的欢…

ant 修改组件默认样式属性

得在 less 里面使用 :global 修改,不能是css文件. :global 修改是全局生效的,所以建议修改之前要加上calssName="样式名"; 不是 className={style.样式名} ,是直接写“”。 然后在调试工具找到你要修改的样式的属性名,如图: 来个单选框的样式修改代码,效果图:…

构建静态服务器_为静态网站构建无服务器联系表

构建静态服务器介绍 (Introduction) A few years ago AWS launched static hosting service S3, which was a paradigm shift for hosting static websites. The tech was crystal clear, all the static assets (HTML, CSS, and JS) would reside in an S3 bucket to host you…

Yii2之行为

Yii三大特性:属性、事件、行为。前面两篇文章已经分别讲解了属性和事件,本文接着讲讲yii的行为,分析yii行为的实现原理。 在yii中,一个对象绑定了行为之后,就拥有了所绑定行为拥有的所有事件,而且可以访问所…

ACM学习历程—HDU5586 Sum(动态规划)(BestCoder Round #64 (div.2) 1002)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid5586 题目大意就是把一段序列里面的数替换成f(x),然后让总和最大。 首先可以计算出初始的总和,以及每一个值换成f(x)的增益a[x]。 那么就是求一段子序列a[x]的最值了,经典的D…

ant models 内获取 url 的参数传递到组件

models代码: import { getCList} from "@/services/api"; import { MessageTip } from @/utils/tools.js import { router } from umi;const customerModel = {namespace: customerModel,state: {channelList: [], // 渠道列表},reducers: {getUrlQuery(state, { …

软件开发向大数据开发过渡_如果您是过渡到数据科学的开发人员,那么这里是您的最佳资源...

软件开发向大数据开发过渡by Cecelia Shao邵Ce It seems like everyone wants to be a data scientist these days — from PhD students to data analysts to your old college roommate who keeps Linkedin messaging you to ‘grab coffee’.如今,似乎每个人都想…

php随笔(1)

PHP标记的四种风格 1、XML风格 <?php echo <p>Hello world</p> ; ?> 2、简短风格 <? echo <p>Hello world</p> ; ?> 3、SCRIPT <script language php>echo <p>Hello wordl.</p>;</script> 4、ASP风格 <% …

微信小程序云开发图片上传完整代码附效果图

在app.json里面加如下代码, 使用 WeUI组件库。点击跳转 "useExtendedLib": {"weui": true}, 先看效果图 wxml <!--pages/publish/publish.wxml--> <view class"page" data-weui-theme"{{theme}}"><view class"w…

图片lightbox2

1. 官网下载 http://lokeshdhakar.com/projects/lightbox2/ 2.引入 css jquery js 3. HTML格式 <a href"images/image-2.jpg" data-lightbox"roadtrip"> <img srcImage #1> </a> <a href"images/image-3.jpg" data-lig…

夏天和空调_您可以在今年夏天开始学习650项免费的在线编程和计算机科学课程...

夏天和空调Seven years ago, universities like MIT and Stanford first opened up free online courses to the public. Today, more than 900 schools around the world have created thousands of free online courses, popularly known as Massive Open Online Courses or …