用js控制a标签href属性并实现跳转

layuiAdmin打开新窗口、新标签页 这里写自定义目录标题前言打开新窗口打开新窗口的代码源码 前言 layuiAdmin.std-v1.2.1 打开新窗口 在控件上添加 lay-href 属性。 <a lay-href="xxxx.html" lay-text="账号列表">打开新窗口</a> 打开新窗口的代码 top.layui.index.openTabsPage(url, title); 打开新窗口的方法: //iframe的方式打开 参数:url地址 tit标题 function newTab(url, 阅读详情

由于项目改动,主要由于页面基类中重写OnInit()事件中添加是否首次访问网站:

[c-sharp] view plain copy
  1. //检查是否首次访问本网站  
  2. if (HttpContext.Current.Request.UrlReferrer == null)  
  3. {  
  4.     // Code...  
  5. }  

 

原先使用的js控制的语句跳转使HttpContext.Current.Request.UrlReferrer失效,导致错误

因此修改原跳转代码:

[javascript] view plain copy
  1. function upOrDown(f)  
  2. {  
  3.     function callbackFun(data)  
  4.     {  
  5.        //成功  
  6.         if(data > 0)  
  7.         {  
  8.             //location.href="Show_Blog.aspx?blogid=" + data;   
  9.             //获取<a>标签对象  
  10.             var a = document.getElementById("blogShow" + f);  
  11.             //指定<a>标签的href  
  12.             a.href = "Show_Blog.aspx?blogid=" + data;  
  13.             //取消<a>标签原先的onclick事件,使<a>标签点击后通过href跳转(因为无法用js跳转)^-^  
  14.             a.setAttribute("onclick",'');  
  15.             //激发标签点击事件OVER  
  16.             a.click("return false");  
  17.         }  
  18.         else  
  19.         {  
  20.             alert("<%=GetLocalResourceObject("js_show_noInfo")%>");  
  21.         }  
  22.     };  
  23.       
  24.     //此实为Query框架$.Ajax()方法的马甲^-^  
  25.     LoadAjax("/Commonality/blog/blog.ashx?action=upordownblog",{uid:<%= this.uid %>,blogid:<%= this.blogid %>,myRight:<%= this.myRight %>,flag:f},callbackFun);  
  26. }  

 

[xhtml] view plain copy
  1. <a href="javascript:void(0)" mce_href="javascript:void(0)" id="blogShow1" onclick="upOrDown(1);return false;"><%=GetLocalResourceObject("ui_show_upper")%></a> 
LayUI入门 layui入门 阅读详情

相关推荐

MIMIC数据库基本信息分析

一、MIMIC数据库中26张表介绍 数据库中一共有26张表,记录患者入院的各种信息,每张表的介绍如下所示。 表格名 信息 admission 患者基本信息,比如性别、种族、语言、宗教、婚姻、入院和出院时间、死亡时间等 callout 提供病人准备从ICU转出或者已经从ICU转出时相关信息 caregivers 记录医护人员信息(ID、类型、附加...

m0_37520426的博客 1万+

layui使用--lay-href

需求: 在操作日志里边 点击用户id, 需要带着这个id跳转到账号列表里, 并且搜索出这个用户的信息: 一开始是知道 给a标签设置一个lay-href: <a lay-href="xxx.html">用户id</a> 跳转是可以跳转了, 但是有一个问题, 如下: tab的title变成了前一个页面的用户id, 然后, 找了资料, 发现需要这样设置: ...

。 2万+

zabbix添加IBM服务器SNMPV3监控

本地采用欧冠的是zabbix5.0,服务器型号是SR860,使用snmpv3因为只支持这个,醉了。说明:本地采用欧冠的是zabbix5.0,服务器型号是SR860。

萌新包大人的博客 1990

lay-href页面不跳转

底部这段js是页面跳转的关键,这两段js有报错需要检查一下路径 <script src="__LAYUI__/layui.js"></script> <script> layui.config({ base: '__LAYUI_ADMIN__/' //静态资源所在路径 }).extend({ index: '/lib/index' //主入口模块 }).use('index'); </script>

qq_40787608的博客 2534

VCSA 6.7证书更新全流程指南:从故障诊断到完整替换

本文详细介绍了VCSA 6.7证书更新的全流程,包括故障诊断、证书替换操作步骤及常见问题解决方案。通过使用官方脚本和证书管理器,帮助管理员快速解决证书过期问题,确保vCenter系统的稳定运行。特别强调了STS证书修复和全量证书重置的关键步骤,适用于vcsa6.7环境下的证书管理需求。

weixin_42634811的博客 454

多模态RAG实战:为LLM装上视觉之眼,实现图文混合文档智能问答

检索增强生成(RAG)技术通过结合外部知识库,有效缓解了大语言模型(LLM)的幻觉问题,并扩展了其知识边界。其核心原理是将文档切分、向量化后存入向量数据库,在问答时通过语义检索召回相关上下文,辅助LLM生成更精准的答案。这项技术的核心价值在于,它为大模型应用提供了一种低成本、高效率的知识注入与实时更新方案,广泛应用于智能客服、知识库问答、文档分析等场景。随着应用深入,纯文本RAG在处理产品手册、学术论文、设计图纸等富含视觉信息的文档时面临瓶颈。本文聚焦的**多模态RAG**和**视觉理解**技术,正是为了解

weixin_30698527的博客 728

通过JQ修改a标签原有的href,并增加一个跳转方法

有时a标签里的src属性已经写好,但是我的需求是,当我点击a标签后,不让它默认跳转,要让他按照我指定的方法跳转,如: &lt;a href="http://www.baidu.com"&gt;&lt;/a&gt; 当我们点击a标签时,不想让他跳转至www.baidu.com这个页面。可通过以下JQ修改: $("a").attr("href","javascript:atump()") fu

weixin_41760500的博客 4220

从零到一:RK3588平台上的星闪模块驱动移植全解析

本文详细解析了在RK3588平台上移植UB37星闪模块驱动的完整流程,涵盖内核配置、设备树适配、驱动编译、功能测试等关键步骤。通过实践指导,帮助开发者掌握星闪技术在嵌入式系统中的集成与应用,提升无线通信模块的开发效率。

qsc90123456的博客 345

a jquery 标签点击不跳转_如何解决点击A链接不跳转页面却能改变href值

有时候可能有这样的需求,当我点击a链接的时候,不需要实现跳转但是可以改变href中的值。有人会问为什么要用a,为什么不使用其他的标签呢。我只能说我的需求就是这样的。刚拿到这个问题,我觉得可以用javascript:void(0);防止跳转,但是问题来了,我还要重新的赋值href,当我点击的时候还是会把javascript:void(0);改掉,再次的点击就会跳转。终于找到了解决的方法。在a标签上面...

weixin_42399388的博客 1005

企业级智能问数开发的核心痛点与技术聚焦

本文介绍了企业级智能问数系统开发的三大核心问题和解决方案:语义解析不精准、SQL生成不健壮、企业适配难落地。文章从开发者视角出发,详细拆解了NLU语义解析、SQL生成、对话记忆、企业级适配四大核心模块的技术实现。 在技术选型方面,推荐了LangChain+DeepSeek-R1、FAISS/Milvus、SQLAlchemy等工具链组合。针对企业级需求,重点讲解了: 语义解析模块的意图识别优化和要素提取技术 SQL生成模块的语法校验与性能优化方案 对话记忆模块的Redis存储实现 企业级适配的三层防护体系和

lamehsl的专栏 1054

RTKLIB PPP与RTK_POST精密定位实战:从实时到事后处理的完整流程解析

本文详细解析了如何使用RTKLIB进行精密单点定位(PPP)的完整流程,涵盖从实时处理到事后处理(RTK_POST)的关键步骤。文章深入探讨了数据准备、软件配置、核心参数设置(如电离层、对流层、潮汐改正)以及常见问题排查,旨在帮助用户掌握高精度GNSS定位技术,实现从入门到精通的实战应用。

weixin_29047919的博客 291

JavaScript 之 阻止 a 标签的默认跳转行为的三种方法

第一种:给 a 标签的 href 属性赋值 <a href="javascript: void(0)">跳转页面</a> 第二种:给 a 标签增加一个点击事件,并且return false <a id='aDom' href="http://baidu.com">跳转页面</a> let aDom = document.getElementById(); aDom.onclick = function(e){ retrun false; } 第三种:给

zhuang的博客 1万+

CloudCompare 二次开发(17)——点云添加均匀分布的随机噪声

使用CloudCompare编程实现点云添加随机噪声。

点云侠的博客 840

“width+padding+position百分比-实现响应式布局” and “a标签的使用” and “背景图的设定” and “三目运算在标签中的使用”

<ul> <li v-for=(item, idx) in list> <a :href='item.link || "javascript:void(0);"' :style='`cursor: ${item.link ? "pointer" : "auto"}; backgroundImage: url(${item.url});`' target='_blank' ...

青蛙king的博客 209

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

a链接中关于this的使用

a连接点击事件用 this 时,要用 onclick='click(this)',href='javascript:void()' a连接无法使用,要看看是不是自动变成ie7或者更低 转载于:https://www.cnblogs.com/change4now/p/5665134.html...

weixin_30824479的博客 166

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

模仿element-ui重写分页器——Nuxt框架,使用a标签进行页面跳转,SEO优化

nuxt框架,页面列表翻页,使用a标签重写分页器,携带网站内链,SEO优化

weixin_44741164的博客 1194

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

HTML_a标签实现锚点

本文介绍了HTML锚点链接的实现方法,通过href="#id"和对应元素的id属性实现页面内跳转。示例代码展示了三个锚点链接的实现,点击链接可跳转到相应内容区域。文章还提供了增强用户体验的建议,如使用CSS的:target伪类实现跳转目标高亮效果。最后指出注意事项:锚点名称需唯一,现代SPA框架可能需要路由方案替代,并提到可通过scrollIntoView()方法实现更精细的控制。全文简明扼要地阐述了锚点链接的基本原理和进阶应用。

2303_81899122的博客 102

a标签常用属性——你是否都用过?

a标签常用属性:target,href,download。

cai niaoyihao_的博客 1万+

前端开发a标签中的href=““和href=“JavaScript:;“不同收录

在这种情况下,javascript:;因此在点击了标签之后,虽然浏览器同样会执行导航的动作,但不会刷新页面,此时导航的目标不是某个页面了,而是一段代码。当 href 属性为空字符串时,根据规范和不同的浏览器行为,这种链接可能被处理为尝试导航到当前页面的根路径,或者在某些情况下,它可能导致页面的刷新。此外,早期的浏览器中,这样的链接可能会导致页面跳转到页面的顶部。"代表的是使用js代码来代替这个跳转事件,而冒号后面的js代码空,所以就是不执行任何js操作,开发中有时会加上“void(0)”这是合理的写法。

1296

javascript a标签href点击不进行跳转的解决办法

a标签的href 跳转失效的问题 我找到两个解决办法:记录如下: 在你的URL最后添加一个随机的参数,这样写的原因,是可能浏览器认为你需要跳转的URL与当前页面的URL是一样,所以加上随机参数,能够解决(但是这个方案对我的问题不管用,但是放出来,或许能帮到一些人) 舍弃href属性,在<a>标签中使用onclick方法:οnclick="window.location = 'URL' ",href:"###",完美解决问题。 ...

yehaocheng520的博客 1万+

简单明了《a标签的href》跳转页面情况,看完秒懂!!!

概念 a标签的默认跳转链接行为是由href来实现的,同时设置href属性可以使a标签在hover状态下以手指指示的样式显示。但实际过程中发现对a标签的href属性的不同设置,可能会导致不同的行为反馈,故想要进行几种不同的设置情况总结一下。 1.a标签中设置href属性,没有赋任何值 <a href></a> 点击a标签会刷新页面,回到顶部。 2.a标签中设置href属性,赋值href="#" <a href='#'></a> ..

Sestid的博客 1万+

利用JS实现a标签“指定页面跳转”和“连续查询跳转”

被迫做前端篇:“不会没关系,是你的认知限制了你” 指定页面跳转: a标签同时含有onclick和href优先执行onlick,如果js不做限制的话,onlick执行完成后,将继续跳转href。 <!-- HTML--> <a onclick="DoingURL()" href="/category/1/">点击跳转</a> <script&gt...

AIRBOYONE的博客 3480

a标签href不跳转 禁止跳转

a标签href不跳转 禁止跳转

前端小胡兔的博客 8449
上一篇: Ztree ajax关键字检索动态树
下一篇: FusionCharts参数的详细说明
gwpJava
博客等级 码龄14年 11粉丝 91原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址