window.status无法正常工作 [英] window.status not working
问题描述
我已按下按钮点击事件,因此我调用onclick事件javascript:CallingEventTrackRelatedJoint以跟踪事件&使用C#函数btnEventTrack_Click后面的代码重定向页面。由于跟踪事件,我没有使用html标记来指定href。
我想在状态栏中显示href文本&所以我设置了window.status,但它不起作用。
如何在状态栏中显示href文本请帮助我。
以下是我的代码。
I Have tracked Event on button click so I call onclick event javascript:CallingEventTrackRelatedJoint for track the event & Redirect page using code behind C# function btnEventTrack_Click.I not specift href with a html tag due to track event.
I want to display href text in status bar & so i set window.status but it is not work.
how can I display href text in Status bar please help me.
Below is My Code.
<span style="cursor: pointer"><a onclick="javascript:CallingEventTrackRelatedJoint('CONTRIBUTORS',0,'<%#Eval("ContributorID") %>' ,'','','','','ContributorProfile.aspx?ContributorID=<%#Eval("ContributorID") %>','');">
<asp:Label ID="lblContributorName" runat="server" Text='<%#Eval("Name") %>' CssClass="lblContributorname">
我已按下按钮点击事件,因此我调用onclick事件javascript:CallingEventTrackRelatedJoint用于跟踪事件&使用C#函数后面的代码重定向页面btnEventTrack_Click。由于跟踪事件,我没有使用html标记指定href。
我想在状态栏中显示href文本&所以我设置了window.status,但它不起作用。
如何在状态栏中显示href文本请帮助我。
以下是我的代码。
---------------------- ----------
HTML
----------------------- --------
I Have tracked Event on button click so I call onclick event javascript:CallingEventTrackRelatedJoint for track the event & Redirect page using code behind C# function btnEventTrack_Click.I not specify href with a html tag due to track event.
I want to display href text in status bar & so i set window.status but it is not work.
how can I display href text in Status bar please help me.
Below is My Code.
--------------------------------
HTML
-------------------------------
<span style="removed: pointer">
<a önclick="javascript:CallingEventTrackRelatedJoint('CONTRIBUTORS',0,'<%#Eval("contributorid=") %>' ,'','','','','ContributorProfile.aspx?ContributorID=<%#Eval(">
<asp:Label ID="lblContributorName" runat="server" Text='<%#Eval("Name") %>' CssClass="lblContributorname">
</a>
</span>
---------- ----------------------------------
JAVASCRIPT FUNCTION
--------------------------------------------
--------------------------------------------
JAVASCRIPT FUNCTION
--------------------------------------------
function CallingEventTrackRelatedJoint(pstrSectionName,pIntCategoryID, pStrAttributeA, pStrAttributeB, pStrAttributeC, pStrAttributeD, pStrAttributeE, pRedirectPageUrl, pTarget) {
var TrackEventID = '';
var pathArray = window.location.pathname.split( '/' );
var newPathname = "";
for ( i = 0; i < pathArray.length; i++ ) {
if(pathArray[i]=='bethanys-story.aspx')
{
if(pstrSectionName == 'BOOKS')
{
TrackEventID = 30;
}
else if(pstrSectionName == 'CONTRIBUTORS')
{
TrackEventID = 31;
}
}
}
window.status = pRedirectPageUrl;
EventTrack(TrackEventID, pIntCategoryID, pStrAttributeA, pStrAttributeB, pStrAttributeC, pStrAttributeD, pStrAttributeE, pRedirectPageUrl, pTarget);
}
_______________________
EventTrack.js
_________________________
_______________________
EventTrack.js
_________________________
function EventTrack(pIntEventID, pIntCategoryID, pStrAttributeA, pStrAttributeB, pStrAttributeC, pStrAttributeD, pStrAttributeE, pRedirectPageUrl, pTarget) {
document.getElementById('MainContent_hdnEventID').value = pIntEventID;
document.getElementById('MainContent_hdnCategoryID').value = pIntCategoryID;
document.getElementById('MainContent_hdnAttributeA').value = pStrAttributeA;
document.getElementById('MainContent_hdnAttributeB').value = pStrAttributeB;
document.getElementById('MainContent_hdnAttributeC').value = pStrAttributeC;
document.getElementById('MainContent_hdnAttributeD').value = pStrAttributeD;
document.getElementById('MainContent_hdnAttributeE').value = pStrAttributeE;
document.getElementById('MainContent_hdnRedirectPageUrl').value = pRedirectPageUrl;
document.getElementById('MainContent_hdnTarget').value = pTarget;
document.getElementById('MainContent_btnEventTrack').click();
return false;
}
________________
C#背后的代码
________________
________________
Code Behind C#
________________
protected void btnEventTrack_Click(object sender, EventArgs e)
{
Decimal decMemberID = 0;
CommonFunctions.TrackEvent(decMemberID, Convert.ToDecimal(hdnCategoryID.Value), Convert.ToDecimal(hdnEventID.Value), hdnAttributeA.Value, hdnAttributeB.Value, hdnAttributeC.Value, hdnAttributeD.Value, hdnAttributeE.Value);
if (hdnRedirectPageUrl.Value != String.Empty)
{
Response.Redirect(hdnRedirectPageUrl.Value);
}
}
请尽快帮助我。
Please help me asap.
推荐答案
Window.status
注意: 大多数现代浏览器不再允许它,因为它被滥用来隐藏链接目的地。
干杯,
Edo
Window.status
is not supported cross browser!
NOTE: most modern browsers don''t allow it any more as it was abused to hide link destinations.
Cheers,
Edo
这篇关于window.status无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!