Javascript escaping problem
I think i have an escaping problem, could someone please help me out:
<script>
function deleteConfirm(ID, thema){
var theText = "" + thema;
if( confirm("Weet u zeker dat u " + theText + " wilt verwijderen?")) {
document.location='lib/event_frm_process.jsp?action=delete&ID='+ ID;
</script>
Link using this function:
<a href="\"javascript:deleteConfirm('<%=resultset.getString("ID")%">','<%=resultset.getString("thema")%>');"\><img src="images/verwijderen_hog_icon.gif" width="20" height="19" border="0" align="absmiddle"></a>
Thank you in advance .......</a>
Try:
<a href="javascript:deleteConfirm('<%=resultset.getString("ID")%>','<%=resultset.getString("thema")%>');"\>The quotes inside the <%= %> do not conflict with the HTML quotes since they are handled server side and the HTML/javascript is handled client side.
If that doesn't work, you will have to look at the HTML generated and see what the text coming out of the result set it (if it contains quotes or apostrophes itself). It the string coming from the result set is problematic you will have to re-arrange your quotes or process it some more before it is inserted...
Similar Messages
-
How can I decode Japanese character using java from JavaScript escape() function
Hi:
I have an application which supports Japanese character. I am using JavaScript escape() function to encode the text field before I posted it through web server and then I will just convert it into hex number to decode it through an Integer. It works fine for the character between ascii 1-255. However, it faild on all the double bytes character. All the unicode has the format of "%uXXXX" after it is escaped from JavaScript. How can I resolve the decoding problem?
Thank,
DavidPlease use 'encodeURI()', though it is supported only IE after 5.5.
I'm not sure Netscape.
Thanks,
Katsumi
dwang <[email protected]> wrote:
Hi:
I have an application which supports Japanese character. I am using JavaScript
escape() function to encode the text field before I posted it through
web server and then I will just convert it into hex number to decode
it through an Integer. It works fine for the character between ascii
1-255. However, it faild on all the double bytes character. All the
unicode has the format of "%uXXXX" after it is escaped from JavaScript.
How can I resolve the decoding problem?
Thank,
David -
Javascript escape() function
Hello everyone,
I have a select input in a form, some of the options have strings in which there is
a space. like "San Francisco", "Los Angelos". I know javascript escape function can transform
those strings to URL string like, "San%20Francisco". But i tried several times with no luck:
Here is my code:<select name="city">
<option value=escape('<%= cityName%>') selected> <%= cityName%>
</select> The value it submitted to server is not what I expected, it submit the whole thing:
escape("San Francisco").
Does anyone know what is the right way to invoke escape function in this circumstance?
Thank you in advance !
RachelHmm.. it should be the same for GET or POST. The javascript encode function doesn't work the way you were using it. It would work if you did something like this:
<script>document.write('<option value="<%=city%>"><%=city%></option>');</script>
But the problem with this is you need to make the user aware that they need to have JavaScript enabled. So better to encode in Java before writing with URLEncoder, like you said.
But I'm pretty sure GET or POST shouldn't be different for that type of thing. Browser bug, maybe? -
Javascript security problem in IE/Netscape
I am facing with the javascript security problem in IE/Netscape. I have solved this problem partially, but there are more issues involved.
Here's the scenario:
There is an HTML page on client's hard disk (main.htm) containing two frames:
frame 1 contains a page that lies that is deployed from my server, say
src="http://127.0.0.1:8080/MyApplication.htm"
frame 2 contains a page that lies on the client's server, say
src="http://www.clientside.com/clientPage.htm"
My page in frame 1 wants to access the URL of the page in frame 2 (through a button click, say ). This is done in MyApplication.htm through javascript as:
window.parent.frame2.location.href;
Now when the above line is executed, i get the following error:
In IE(5.0): "permission denied"
In Netscape(4.7): "access disallowed from scripts at http://127.0.0.1:8080/MyApplication.htm to documents at another domain."
(which is understandable)
I have partially solved the above problem in Netscape, by granting access permissions to MyApplication.htm (page on my server) to access the
"http://www.clientside.com/clientPage.htm" page at client's domain.
This is done as follows:
1. First enable code base principals in client's Netscape by adding the following line in prefs.js file of Netscape
"user_pref("signed.applets.codebase_principal_support", true);"
2. Secondly i must add the following line in java script of "MyApplication.htm"
"netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserAccess");"
Now when the client clicks the button on my frame he'll get a netscape window asking him to grant permissions to MyApplication.htm.
After granting permission, MyApplication.htm can retrieve the URL of clientPage.htm (even if he browses to another url)
As you can see this problem is solved partially, but i want that the page "main.htm" (which is now on the client's hard disk),
must be deployed at client's server (in which case not even the above technique works).........what should i do? any alternates or other solution?
Secondly i want this to work with IE too, (which should according to their documentation, but does not and is therfore a big IE bug-as mentioned on the net)
Any sort of help in this case would greatly appreciated.
Thanks
Faisal Moin Khani believe you are posting in the wrong forum.
This forum is foro XML web services. -
Pl/sql encoding javascript parameter problem
I am using an html form to get user input via radio buttons via the following segment
htp.p('<input type="radio" value="a" onSelect="saySomething('fish')">');
However, when the brackets surrounding (fish) are encountered an error occurs
Line No. 41 : PLS-00103: Encountered the symbol "FISH" when expecting one of the following:
. ( ) , * @ % & | = - + < / > at in mod not range rem => ..
<an exponent (**)> <> or != or ~= >= <= <> and or like as
between from using is null is not || is dangling
The symbol ". was inserted before "FISH" to continue.
(WWV-17050)
ORA-24344: success with compilation error (WWV-11230)
Critical Error in wwerr_api_error.get_errors! SQL Error Message: ORA-06502: PL/SQL: numeric or value error: character string buffer too small (WWV-)
Is there a better way to program user input or how can I overcome the javascript parameter passing problem
Many regards
EddieTo include single quotes into literal strings in SQL and PL/SQL, you need to escape (double) them or replace them with concatenations with CHR(39):
htp.p('<input type="radio" value="a" onSelect="saySomething(''fish'')">');
or
htp.p('<input type="radio" value="a" onSelect="saySomething('||chr(39||'fish'||chr(39||')">'); -
Javascript menu problems in IE
Hi
I am using a javascript menu for a website I am trying to
build, I have tested it on many browsers and thought it was working
fine, it's fine on all the macintosh browsers, works fine on
firefox on the PC but there seems to be problems on some versions
of IE. Especially runing XP but am not sure about vista.
You dont seem to be able to see the menu when the page loads,
you can see something is there and the buttons show when you hover
over them, but they are kicked out of place.
here is the code if it helps
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />
<title>Ecoligical Planning and Research
Ltd</title>
<link href="epr.css" rel="stylesheet" type="text/css"
/>
<script src="Scripts/AC_RunActiveContent.js"
type="text/javascript"></script>
</head>
<body bgcolor="#cfdcce">
<table width="800" border="0" align="center"
bgcolor="#FFFFFF" class="greenborderoutline">
<tr>
<th height="29" align="left" scope="col"><div
class="menu" id="menu">
<script type='text/javascript'
src='quickmenu.js'></script></div></th>
</tr>
<tr>
<td height="132"><script type="text/javascript">
AC_FL_RunContent( 'codebase','
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','nam e','eprbanner','width','800','height','168','id','eprbanner','title','banner','src','eprba nner','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','wmode' ,'transparent','movie','eprbanner'
); //end AC code
</script><noscript><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
name="eprbanner" width="800" height="168" id="eprbanner"
title="banner">
<param name="movie" value="eprbanner.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<embed src="eprbanner.swf" width="800" height="168"
quality="high" pluginspage="
http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" wmode="transparent"
name="eprbanner"></embed>
</object>
</noscript></td>
</tr>
<tr>
<td height="304" valign="top"><table width="798"
height="131" border="0">
<tr>
<th width="513" scope="col"><p
class="bodycopyHomepage"><strong>Ecological Planning
& Research Ltd</strong> is
<th width="275" scope="col"><span
style="margin:0px"><img src="images/office.jpg" alt="Head
Office" name="eprOffice" width="241" height="296" align="left"
id="eprOffice" /></span></th>
</tr>
</table> </td>
</tr>
<tr>
<td height="105"><img src="images/btBanner.gif"
alt="btBanner" width="800" height="103" align="top"
/></td>
</tr>
</table>
<table width="800" align="center" border="0">
<tr>
<th scope="col"><div align="left"
class="copyright">©<strong> 2007</strong>
Ecological Planning and Research Ltd </div></th>
</tr>
</table>
<p> </p>
</body>
</html>
any help here would be great as I am really stuck
many thanks
JonGad. Ask the authors of the menu for help. Would you REALLY
use something
like that on a web page?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"ronnyrocket" <[email protected]> wrote in
message
news:[email protected]...
> Hi
>
> I am using a javascript menu for a website I am trying
to build, I have
> tested
> it on many browsers and thought it was working fine,
it's fine on all the
> macintosh browsers, works fine on firefox on the PC but
there seems to be
> problems on some versions of IE. Especially runing XP
but am not sure
> about
> vista.
>
> You dont seem to be able to see the menu when the page
loads, you can see
> something is there and the buttons show when you hover
over them, but they
> are
> kicked out of place.
>
> here is the code if it helps
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
> "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="
http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />
> <title>Ecoligical Planning and Research
Ltd</title>
> <link href="epr.css" rel="stylesheet" type="text/css"
/>
> <script src="Scripts/AC_RunActiveContent.js"
> type="text/javascript"></script>
> </head>
>
> <body bgcolor="#cfdcce">
> <table width="800" border="0" align="center"
bgcolor="#FFFFFF"
> class="greenborderoutline">
> <tr>
> <th height="29" align="left" scope="col"><div
class="menu" id="menu">
> <script type='text/javascript'
src='quickmenu.js'></script></div></th>
> </tr>
> <tr>
> <td height="132"><script
type="text/javascript">
> AC_FL_RunContent(
> 'codebase','
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#
>
version=7,0,19,0','name','eprbanner','width','800','height','168','id','eprbanne
>
r','title','banner','src','eprbanner','quality','high','pluginspage','
http://www
>
.macromedia.com/go/getflashplayer','wmode','transparent','movie','eprbanner'
> );
> //end AC code
> </script><noscript><object
> classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
> codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
> rsion=7,0,19,0" name="eprbanner" width="800"
height="168" id="eprbanner"
> title="banner">
> <param name="movie" value="eprbanner.swf" />
> <param name="quality" value="high" />
> <param name="wmode" value="transparent" />
> <embed src="eprbanner.swf" width="800" height="168"
quality="high"
> pluginspage="
http://www.macromedia.com/go/getflashplayer"
> type="application/x-shockwave-flash" wmode="transparent"
> name="eprbanner"></embed>
> </object>
> </noscript></td>
> </tr>
> <tr>
> <td height="304" valign="top"><table
width="798" height="131"
> border="0">
> <tr>
> <th width="513" scope="col"><p
> class="bodycopyHomepage">
Ecological
> Planning & Research Ltd is
> <th width="275" scope="col"><span
style="margin:0px"><img
> src="images/office.jpg" alt="Head Office"
name="eprOffice" width="241"
> height="296" align="left" id="eprOffice"
/></span></th>
> </tr>
> </table> </td>
> </tr>
> <tr>
> <td height="105"><img src="images/btBanner.gif"
alt="btBanner"
> width="800"
> height="103" align="top" /></td>
> </tr>
> </table>
>
> <table width="800" align="center" border="0">
> <tr>
> <th scope="col"><div align="left"
class="copyright">©
2007
> Ecological Planning and Research Ltd
</div></th>
> </tr>
> </table>
> <p> </p>
> </body>
> </html>
>
>
> any help here would be great as I am really stuck
>
> many thanks
>
> Jon
> -
XSLT HTML output escaping problem
I am having problems with JAXP XSLT output escaping in HTML. I have an XML document which correctly escapes &, <, > etc (eg: &). However, when I transform the document the XSLT processor is escaping these values again. This means that the HTML output contains & where the XML document contains & (for example). Surely correctly escaped characters in the XML should be left alone? Or should the XML document not contain escaped characters? In my understanding special characters in text nodes of XML documents should be escaped. Obviously a work around is to disable output escaping on these nodes but that is a real pain to have to do each time you pull a value through from the XML document. I'm confused as to what format the XSLT processor expects the XML to be in in relation to escaping of elements. Any information gratefully accepted!
Thanks.Sorry! I was getting confused - the special characters were being escaped twice before they reached the XSLT processor. It looks like the processor will leave alone escape sequences that are already in the XML when it transforms to HTML.
-
JavaScript Console Problem (only in LS preview mode)
Hello,
my JavaScript console "crashes" in preview-mode in lifecycle designer. It just appears for a "millisecond"´, well I see it flicker at last.
It doesn't matter if there is a syntax error or if I try to start the console by clicking a button ( Event click => console.show(); )
The console just flickers.
If I save the pdf file everything works fine. Console shows up on errors or if it told to do so (e.g. my button is clicked).
I cannot afford to save the pdf-file every time for some reasons (livecycle designer is used in sap gui, I have to run the whole process to get the PDF ...)
By the way, the same problem is present in Livecycle Designer if I use it "native", not called from within the sap.
I have already tried to close the acrobat reader tasks. There are two of them, when adobe reader 10 starts (native or in livecycle-preview).
But by closing one of the tasks, the second one closes, too. Therefore there is no help this way.
I use Adobe Lifecycle Designer ES 8.0 (8.01.2008.1.380548) and Acrobat Reader X (10.0.1)
The PDFs output in LS is set to Acrobat 8 (dynamic)
In Acrobat Reader javascript console/debugger is set as active, as well as to show errors etc.
It might be a problem realted to sap gui.
I just ran the pdf-preview in sap gui. And Console didn't show up again.
I have saved the same document from the sap print-preview on my local hd drive. Then started it with adobe reader and everything worked just fine.
Please do not blame sap only. As I have told before: the same problem occurs if I use livecycle designer "native", not within sap guinikg-fh schrieb:
it seems the problem is caused directly by adobe reader X.
I just have started a new descussion here (adobe reader forum).
If anyone could help me, feel free to do so!
my configuration:
windows xp pro
adobe reader x
adobe livecycle designer 9 ( therefore it is not an version 8 issue )
admin rights on the pc ; )
I might add that you are not alone!
I am having the same problem (LSD ES2 (version 9.0.0....) and Adobe Reader X and Acrobat Professional 8)
Whenever I save a form as PDF and open it with Reader or Acrobat I get to see the console.
But never when I view the form in Designer preview!
That used to work until I installed Reader X.
Same as you I checked all configurations in Reader and Acrobat: all perfect.
I really do hope that someone finds a solution for this.
PS. This problem should be discussed in THIS forum. It is clearly a Designer problem! -
Javascript alert problem - select state
I am trying to validate my form with javascript. I'm having
trouble with my state field. If the user selects a state javascript
alerts the following message: "SELECT ONE is not a valid choice.
Please choose your state." I want the alert message to pop up if
select one is selected as a state. How do I fix this problem?pqer wrote:
> I am trying to validate my form with javascript. I'm
having trouble with my
> state field. If the user selects a state javascript
alerts the following
> message: "SELECT ONE is not a valid choice. Please
choose your state." I want
> the alert message to pop up if select one is selected as
a state. How do I fix
> this problem?
>
>
>
> <script language="javascript"
type="text/javascript">
>
> // check to see if the form is blank
> function validForm(contactUs) {
>
>
> if(contactUs.state.value != "SELECT ONE") {
> alert("SELECT ONE is not a valid choice. Please choose
your state.")
> contactUs.state.focus()
> return false
> }
if(!contactUs.state.selectedIndex) {
alert("SELECT ONE is not a valid choice. Please choose your
state.");
contactUs.state.focus();
return false;
Mick
>
> </script>
> -
Validate long date in javascript & OnSubmit problem
hi i need to validate long date format "E, dd MMM yyyy HH:mm:ss" or Thu, 18 Jul 2002 12:52:49 that is key in by the user. but i'm not sure how to do this. i have couples of input data and i'm passing an object to the javascript function validateform using OnSubmit. Which one is better, using OnSubmit or OnCick for this kind of parameter passing. Eg <form method="POST" action="insert.jsp" onSubmit="return validateForm(this)"> However i'm having a problem where when there is an invalid input from the user, it will notify the user but it will also send the form to the insert.jsp at the same time. Therefore the user can't correct the invalid data. The function return false for valid input and true for invalid. Please help!!! urgent.... thanks in advance
Your problem is you have used
<input type="submit" onClick="OnSubmit();">
this won't work.
Instead try
<input type="button" value="someValue" onClick="OnSubmit();">
This may help. All the best. -
Equivalent of JavaScript escape function in PLSQL
Hi,
Is there any equivalent of JavaScript's "escape()" function in PlSql for web development? cos I found that whenever I have links generated in stored procedure with text that has space, single quote and so on will become invalid url syntax when user clicks on the hyperlink.
So I hope to convert the text to valid syntax while generating the link.
Please advise.
Thank you so much.Hi,
CREATE OR REPLACE FUNCTION UNESCAPE_F
(P_TEXT IN VARCHAR2 := null) RETURN VARCHAR2 IS
V_HEX2 VARCHAR2(1);
V_CHAR VARCHAR2(1);
V_TEXT VARCHAR2(4000);
V_RETURN VARCHAR2(4000) := NULL;
V_HEX1 VARCHAR2(1);
BEGIN
IF p_text IS NULL THEN
v_return := NULL;
ELSE
v_text := p_text;
WHILE INSTR(v_text, '%') > 0 LOOP
v_return := v_return | | SUBSTR(v_text, 1, INSTR(v_text, '%') - 1);
v_text := SUBSTR(v_text, INSTR(v_text, '%') + 1);
v_hex1 := SUBSTR(v_text, 1, 1);
v_hex2 := SUBSTR(v_text, 2, 1);
v_text := SUBSTR(v_text, 3);
SELECT
CHR(
(DECODE(v_hex1,'0',0,'1',1,'2',2,'3',3,'4',4,'5',5,'6',6,'7',7,'8',8,'9',9,'A',10,'B',11,'C',12,'D',13,'E',14,'F',15,0) * 16) +
DECODE(v_hex2,'0',0,'1',1,'2',2,'3',3,'4',4,'5',5,'6',6,'7',7,'8',8,'9',9,'A',10,'B',11,'C',12,'D',13,'E',14,'F',15,0) )
INTO v_char
FROM dual;
v_return := v_return | | v_char;
END LOOP;
v_return := v_return | | v_text;
END IF;
RETURN(v_return);
END UNESCAPE_F;
Regards Michael -
JSP Session in JavaScript variable problem
Hi,
I have a session variable msgSize that is being set by a Java file in the session.
aRequest.getSession().setAttribute("msgSize", msgSize);It's value is variable depends on record count of recordset.
In JSP page where I have to assign it's value to a javascript variable. I am doing this a s follows. I have done this in the JSP file.
<script type="text/javascript" >
<!--
function getVal()
m=${msgSize};
-->
</script>First Problem is I am unable to get this value inside a External JS file. It throws error but inside jsp it is working. How can i use this inside External JS?
Second problem is once the above code executed value never refreshed to new value?
Means first time it executed it get value 200 next time again i executed the code the real recordset is 105 but still displaying 200. But when I restart the server next time it takes value 105 by itself....
How I tackle this problem.?
Regards,problem is I am not refreshing the whole JSP page everytime, only refreshing the partial page using ajax call that's why not getting the session new value...
any suggestions what to do to get new value? -
I need to pass a file location into a method as a parameter.
The input to the method is like this in a java properties file.
//Example file location as entered in properties file
C:\home\apps_dev\tomcat\apache-tomcat-6.0.16\shared\lib\QAWSERVE.INII know about escaping but since this is user input, the filename will not be escaped by the user.
I have to pass it to the another method in this original format
C:\home\apps_dev\tomcat\apache-tomcat-6.0.16\shared\lib\QAWSERVE.INIMy problem is, since the backslash character is an escape character, it doesn't resolve as a proper file location.
This is the code I have written
this.iniFile = properties.getProperty("ini-file");
System.out.println(" INI-FILE IS "+iniFile);this is the output.
INI-FILE IS C:homeapps_dev omcatapache-tomcat-6.0.16sharedlibQAWSERVE.INII need to make the output just like the original. How can this escaping be done
Edited by: gcameo on Jul 13, 2009 3:21 AM
Edited by: gcameo on Jul 13, 2009 3:22 AMgcameo wrote:
the properties file is all I have got. Its an application that already exists. We can try going by xml but the impact will be too much for just a single configuration.
I am looking at parsing it myself but have never done so so I looking on the internet. If any of you guys can give me any pointers that will be great.
My other option is to hard code the file into a specific location, but that is bad coding practise and dont feel good about that.
Anyway am impressed how you clearly understood my bone of contention..
RegardsOpen a e.g a FileReader and wrap it in a BufferedReader. Call readLine in a loop and split each line on the first "=". The left part is the key, the right part is the value. You can place each key and value in a Properties object that you have instantiated, and return that instance.
Kaj -
Dear Air-friends,
Have a look at this short html:
<html>
<head>
<script type="text/javascript"
src="AIRAliases.js"></script>
<script>
var i = 0;
var click = function() {
var a = document.createElement("a");
a.innerHTML = "click me " + i++;
a.setAttribute("href", "#");
a.setAttribute("onclick", "click()");
document.getElementById("body").replaceChild(a,
document.getElementsByTagName("a")[0]);
</script>
</head>
<body id="body" onload="click()">
<a />
</body>
</html>
when I run this using adl something strange happens:
- I get a "click 0", after I click a "click 1" and ....
that's it! no continuous "click 2", etc.
I isolated this problem to this example, but actally I need
it for context menus in my air application.
Can someone help? I'm out of ideas.
Thanks,
Harrold KorteHi Joe,
First of all, thanks for your quick reply!
Maybe I isolated the problem a bit too much. In fact, I'm
creating context menus using xslt.
Each time, a new context menu is put under a node called
<div id="wrap-menu"> containing
a <ul> of <a>s. It is in these subsequent
refreshing of the context-menu (produced by xslt)
where I observed this behaviour (first time ok, second time
nop). Should I alter each <a> in the produced context-menu
with addEventListener afterwards?
I have the feeling that in that case I could didge xslt as
well. Unfortunatly, I'm a big xslt fan to create
html output (instead of all these program lines of unpacking
and DOM manipulation). I'm porting an
application from JS/PHP to Air because of the file system
access which is exactly what I was looking for.
Thanks again,
Harrold Korte -
I am having a problem with one of my pages. When a user goes
to a page I wish to have a hidden div be open based on the URL that
they come in as (they have #anchors). I tried using the
(location.hash) but could not get it to work.
For example if the url is www.mysite.com/bob.php#section1, I
would like the section 1 div to be open when they arrive. The pages
typically have dozens of anchors and hidden stuff.
Here is the javascript I am using to show and hide the div
sections:
function toggleMe(a){
var e=document.getElementById(a);
if(!e)return true;
if(e.style.display=="none"){
e.style.display="block"
} else {
e.style.display="none"
return true;
and what is typically on the page:
<a href="javascript:void(0)" onClick="return
toggleMe('section1')">section1</a>
<table id="section1" style="display: none;" border="0"
cellpadding="0" cellspacing="0">
<tbody><tr>
<td>text text text </td>
</tr></tbody></table>
Any help would be greatly appreciatedI am having a problem with one of my pages. When a user goes
to a page I wish to have a hidden div be open based on the URL that
they come in as (they have #anchors). I tried using the
(location.hash) but could not get it to work.
For example if the url is www.mysite.com/bob.php#section1, I
would like the section 1 div to be open when they arrive. The pages
typically have dozens of anchors and hidden stuff.
Here is the javascript I am using to show and hide the div
sections:
function toggleMe(a){
var e=document.getElementById(a);
if(!e)return true;
if(e.style.display=="none"){
e.style.display="block"
} else {
e.style.display="none"
return true;
and what is typically on the page:
<a href="javascript:void(0)" onClick="return
toggleMe('section1')">section1</a>
<table id="section1" style="display: none;" border="0"
cellpadding="0" cellspacing="0">
<tbody><tr>
<td>text text text </td>
</tr></tbody></table>
Any help would be greatly appreciated
Maybe you are looking for
-
How can I create an auto-incrementing ID field for a web app?
I have a web app for a project database. Customers can login and add a new record to the web app. We need it to provide each new project with a unique and sequential number. The BC ID number for each web app item is unique but of course not sequentia
-
Missing PDF link that is no longer in the document?
Hello - I have this document that previously had a multi-page PDF linked file. After several iterations the PDF images were removed from the document. Recently our IT had decided to rename our servers so all the links in the document had to be relink
-
I've been with Verizon for roughly 13 years now. Through numerous phones, I've always had great service - reliable, good signal, MAYBE 2 dropped calls in all those years. I recently exchanged my old flip phone for an iPhone 5. For the most part, I
-
Regarding display options in smart view
Hi All, good afternoon. In smart view , I would like to select "Member Name and Description" in "Member Name Display Options" section. However that selection is grayed out by system. can you please help me in resolving this issue. thanks in advance.
-
Deleted the photo icon in error
whilst rearranging the icons on the home page, inadventally deleted the "PHOTO" icon - query - how to reinstate it.