|
You have to escape the ' in a string literal with a \
Tooltip(true,escape('Benito\'s Taco Shop'),event)
or you could wrap the string in double-quotes instead:
Tooltip(true,escape("Benito's Taco Shop"),event)
|
|
|
|
|
Hi guys,
I work with EXT JS Framework.I want to place my icon on the left of the fieldlabel of my textField.my code is :
var labelDownloadReport = new Ext.ux.StaticTextField ({
readOnly : true,
scope : this,
fieldLabel : '<a href="javascript: app.Communication.Edit_Cb.downloadReport">Télécharger </a>',
labelSeparator : '',
hidden : this.isNew (),
height : '0',
width : '450',
ctCls : 'app-icon-attachment',
renderer : app.Communication.Edit_Cb.downloadReport
});
my css is :
.app-icon-attachment
{
width : 11px;
height : 11px;
background-repeat : no-repeat;
text-align : right;
background-position : left;
padding-left : 10%;
padding-right : 10%;
background-image : url('../../img/communication/attachment.png') !important;
}
the problem is the icon is always placed on the right of the textField
ty
|
|
|
|
|
guys;
do you know how to Decode Query String parameters in javascript (e.i. 'Code%20Project' to 'Code Project' ).
Help people,so poeple can help you.
|
|
|
|
|
|
No, Sir;
I am not talking about that.
thank you anyway;
100
Help people,so poeple can help you.
|
|
|
|
|
The simple way to do this is to use decodeURI. Funnily enough, you can use encodeURI to encode a URI as well.
|
|
|
|
|
thank you, man. +5
good to learn a new pre defined function
but what i need is to decode a string containing the codes '%24' and '%2F' to the charactors '$' and '/'
so i defined the functions as
function UrlEncode (strinput) {
var outcome = new String(strinput);
var replacements = ['%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D'];
var entities = ['!', '*', '\'', '(', ')', ';', ':', '@', '&', '=', '+', '$', ',', '/', '?', '%', '#', '[', ']'];
var i = 0;
for (i = 0; i < entities.length; i++)
outcome = outcome.replace(entities[i], replacements[i]);
return outcome;
}
but it replaces just the first occurrence of any code.
what mistake i have done?
Help people,so poeple can help you.
|
|
|
|
|
In javascript we have built in method like unescape and escape
escape - method is used to encode
unescape -method is used to decode
(i.e)
var encodeSymbol = unescape("!");
encode the symbol ! to("%21")
var decodeSymbol = unescape("%21");
decode the %21 to symbol !
|
|
|
|
|
Another couple of functions; 100 , Man.
Sir;
I found on W3Schools this note
Note: The escape() function should not be used to encode URIs. Use the encodeURI() function instead.
Could you please tell me why.
*Please consider the function decodeURIComponent()
Help people,so poeple can help you.
modified on Thursday, May 26, 2011 3:37 AM
|
|
|
|
|
Abu AlHassan,
go through this link i think u may get idea.
http://www.albionresearch.com/misc/urlencode.php
|
|
|
|
|
Thank you, sivaguru, for link and also for calling me 'Abu AlHassan'; you know i like this name.
100 , Man.
Help people,so poeple can help you.
|
|
|
|
|
|
Hello,
I would like to ask, is there any way to determine file size before uploading with javascript?
thanks
It is never late to learn
|
|
|
|
|
Helo,
don't make javascript able to read file (informations) locally (on client) !!
Better: Use PHP or other serverside functions to get filesize.
Cu.
|
|
|
|
|
No! If he wants to UPload a file, it's on the client, so the client is the right place to find out the size.
See my answer to OP for more info.
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
The JavaScript security model does not allow access to the client's file system, so there is no direct way. You can use either an ActiveX object or a Java applet . Either way, you'll need the user's permission. Google for "javascript file size" and you'll find some discussions of the problem.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
|
... which just uses ActiveX
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
That's probably why Raja said "dirty way".
|
|
|
|
|
Hello !
i have a javascript Photo Scroller in my page.But the script take some time to load.and the place on the page is empty until the script is loaded.I want to put in that place a " ...loading message" or a animated gif picture , until the script is full loaded.
Can someone help me how to do that ?
Thank you in advance !
|
|
|
|
|
Helo,
please use readyState property of object.
Cu
|
|
|
|
|
Please could you be more precise , because i'm not very familiar with javascript.
My sricpt is :
----------------
---------------
-----------------
Where to put or to use readystate ? I have a animated gif "wait.gif" ? how to use this until the script is loaded ?
Thank You !
|
|
|
|
|
|
this is for whole page.
i have a script in specific position on the page.and on this position i want to display a "waiting message" until the script full loads.
|
|
|
|
|
Hi,
I have an application that uses frames.
I am calling a method in parent frame as below.(below method is in child frame)
function my MyChild()
{
var pth = window.location.href;
//http://localhost/Main/SUB/Child.aspx[^]
parent.frames["MainFrame"].MainMethod();
}
below is my function in parent Frame, and I am trying to open a new window but that is opening new page in child location
I am using below code , is ter any way so that I can track the URL it is trying to open.
function MainMethod()
{
var path=window.location.href; //below is the value
//http://localhost/Main/Parent.aspx[^]
window.open("Newpage.aspx");
//it is opening in http://localhost/Main/SUB/NewPage.aspx[^]
But I am expecting it will open in http://localhost/Main/NewPage.aspx[^]
}
Please suggest how Can i get the URl path it is trying to open, since window.location.href is giving differnt value.
Thanks,
|
|
|
|
|