在不同页面上创建指向呼叫按钮单击事件的HTML链接

问题描述 投票:0回答:1

根据下面的代码,我能够创建一个带有参数的链接,该参数将导航到所需的目标页面:

<style>
    .fancy-link{
        color: #FFFFFF;  
        text-decoration: none;  
        transition: all 0.3s linear;  
        -webkit-transition: all 0.3s linear;  
        -moz-transition: all 0.3s linear;
        border-radius: 4px; 
        border: 1px solid black; 
        background: #0080FF;  
        padding-top: 0px;  
        padding-left: 5px; 
        padding-right: 5px; 
        padding-bottom: 0px; 
        width: 100px;  
        height: 10px; 
        font-size: 15px; 
        font-weight: bold;} 

  .fancy-link:hover{ 
        color: #F44336;   
        padding-left: 10px;}
</style>

<html>
<a class="fancy-link" name="View" id="View"
  href="'||'https://XXXXXX-sb1.app.website.com/app/common/custom/custrecordentry.nl?
  rectype=142&id='||{internalid}||'"target="_blank">Check-In</a>
</html>

虽然这很有用,但我的预期目标是使此链接实际调用以下按钮单击事件/元素,这些事件/元素位于@所需的URL(请参见上方的href),而无需实际导航至该页面。这可能吗?如果是这样,那么一些代码示例将非常有帮助。

 .<input type="button" style="" class="rndbuttoninpt bntBgT"value="Check-In" id="custpageworkflow157" name="custpageworkflow157"onclick="try{
    if (!!window) {
        var origScriptIdForLogging = window.NLScriptIdForLogging;
        var origDeploymentIdForLogging = window.NLDeploymentIdForLogging;
        window.NLScriptIdForLogging ='CUSTOMSCRIPT_STICK_USER_PREFERENCE';
        window.NLDeploymentIdForLogging= 'CUSTOMDEPLOY_STICK_USER_PREFERENCE';
    }
    try{
        NS.Workflow.buttonClick('custpageworkflow157');
    }
    catch(e){
        document.location = addParamToURL(addParamToURL(addParamToURL(document.location.href,'workflowbutton','157'),'workflowbuttoninstanceid','84083'),'workflowbuttonobsoletehandling','T');
    }
}
finally{
    if (!!window) {
        window.NLScriptIdForLogging = origScriptIdForLogging;
        window.NLDeploymentIdForLogging = origDeploymentIdForLogging;
    }
}
;
return false;
"onmousedown="this.setAttribute('_mousedown','T');
setButtonDown(true, false, this);
" onmouseup="this.setAttribute('_mousedown','F');
setButtonDown(false, false, this);
" onmouseout="if(this.getAttribute('_mousedown')=='T') setButtonDown(false,false, this);
" onmouseover="if(this.getAttribute('_mousedown')=='T') setButtonDown(true, false, this);
" _mousedown="F">
html css
1个回答
0
投票

您应该可以在创建的按钮中使用一个简单的事件侦听器来解决这个问题:

© www.soinside.com 2019 - 2024. All rights reserved.