On Click function does not execute

时间:2015-05-12 23:29:01

标签: javascript php function onclick

This is a long page, so I will attach the full documentation, but summarize here. I have a series of map elements that when clicked, are supposed to active a description page. The relevant code is:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
 DeleteCommand="DELETE FROM [uyeler] 
                WHERE [Kimlik] = ?" 
 InsertCommand="INSERT INTO [uyeler] 
               ([Kimlik], [uye_ad], [uye_soyad], [kadi], [sifre], [mail], [tc]) 
                VALUES (?, ?, ?, ?, ?, ?, ?)" 
 ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
 SelectCommand="
     SELECT * FROM [uyeler] 
     WHERE ([mail] = ?)" 
UpdateCommand="
     UPDATE [uyeler] 
     SET [uye_ad] = ?, [uye_soyad] = ?, [kadi] = ?, [sifre] = ?, [mail] = ?, [tc] = ? 
     WHERE [Kimlik] = ?
">

The show Panel function is:

    <map id="mapg0" onclick="showPanel('pecheislandrear')" style="position:fixed; z:2">
        <area shape="poly" coords="11,13,13,11,14,11,14,3,12,1,11,0,3,0,1,2,0,3,0,11,2,13,3,14,11,14" alt="" title="Peche Island Rear Range" id="mapg0_1">
    </map>
        <img alt="Peche Island Rear Range" onclick="showPanel('pecheislandrear')" usemap="#mapg0" src="LakeErie1_files/reddot.png" id="imageg0" style="position:absolute; z:1; left:210.258015267px; top:348.347527764px; width:14px;height:14px;">
    <map id="mapg1" onclick="showPanel('stclairflatsfront')" style="position:fixed; z:2">
        <area shape="poly" coords="11,13,13,11,14,11,14,3,12,1,11,0,3,0,1,2,0,3,0,11,2,13,3,14,11,14" alt="" title="St. Clair Flats front Range" id="mapg1_1">

Even if I insert an "alert" dialog at the start of this, the alert doesn't show. But, if I substitute

function showPanel (panelId)
{
    document.getElementById(panelId).style.visibility = 'visible';
}

I get the alert, so the "onclick" is acting. The other piece of this s the panel I wish to active:

    <map id="mapg0" onclick="alert ('pecheislandrear')" 

The entire htm is attached for review.enter link description here I would appreciate guidance. A test case with only 2 objects worked. The longer case with 68 does not and I have been unable to discern the difference.

1 个答案:

答案 0 :(得分:0)

if you put -- Some sample data. declare @Transactions as Table ( TransactionId Int Identity, TransactionDate Date, Value Int ); insert into @Transactions ( TransactionDate, Value ) values ( '20141125', 10 ), ( '20150311', 20 ), ( '20150315', 5 ), ( '20150509', 42 ); select * from @Transactions; with -- Determine the first and last dates involved. Range as ( select Min( TransactionDate ) as FirstDate, Max( TransactionDate ) as LastDate from @Transactions ), -- Generate a set of all of the months in the range. Months as ( select DateAdd( month, DateDiff( month, 0, FirstDate ), 0 ) as Month, DateAdd( month, DateDiff( month, 0, LastDate ), 0 ) as LastMonth from Range union all select DateAdd( month, 1, Month ), LastMonth from Months where Month < LastMonth ) -- Summarize the transactions. select M.Month, Coalesce( Sum( T.Value ), 0 ) as Total from Months as M left outer join @Transactions as T on DateAdd( month, DateDiff( month, 0, T.TransactionDate ), 0 ) = M.Month group by M.Month order by M.Month option ( MaxRecursion 1000 ); inside alert() does that run? what if you try this:

showPanel