I need a similar function in PHP for this JavaScript function
text = text.replace(/ffc/g, "Hello");
I think preg_replace will do, but i'm not sure how to write the expression..
I've just updated to the AJAX Control Toolkit 3.5, changed the ScriptManager to the ToolkitScriptManager in my master page and now the following javascript error occurs when an Edit button is clicked:
"Object doesn't support this property or method"
The line of code cuasing the error is:
this._destroyTree(updatePanelElement);
Any initial ideas before I post masses of code?
There is showdown.js to convert markdown to HTML, and PHP Markdown to convert markdown to and from HTML. My question is, is there javascript library to convert HTML to markdown?
The text box should accept onli decimal values in javascript. Not any other special characters. It should not accept "." more than once. For ex. it should not accept 6.....12
Can anybody help???
Please can anyone translate this python code into javascript.
#
def strip_punctuation(s):
#
for c in ',.":;!%$':
#
while s.find(c) is not -1:
#
s.replace(c, '')
Firebug is certainly a wonderful tool for javascript debugging; I use console.log() extensively.
I wanted to know if I can leave the Firebug-specific code in production.
What's the best practice? Commenting the debug code?
Greetings,
how can I inject c# code (my Model property) inside javascript? I want to do something like this:
$(".star<%=Model.ROWGUID %>").mouseover(function() {
var span = $(this).parent("span");
var newRating = $(this).attr("value");
setRating(span, newRating);
});
How can I check if an anonymous object that was created as such:
var myObj = {
prop1: 'no',
prop2: function () { return false; }
}
does indeed have a prop2 defined?
prop2 will always be defined as a function, but for some objects it is not required and will not be defined.
I tried what was suggested here: http://stackoverflow.com/questions/595766/how-to-determine-if-native-javascript-object-has-a-property-method but I don't think it works for anonymous objects .
How do I check if the user accepted a file download in javascript. Example: if the site pops up a download link, and the web browser asks the user to download the file, how do I determine on that page if the user accepted the download or not?
This is my JavaScript code:
<script>
function change(name){
var element = document.all.name.value;
}
</script>
It returns an error. How to pass to the function the element's name in order to change its value?
I know that it is a databases in Palm OS, as the development is shift to webOS. Is there any third party javascript library to do the work? or it needs to write manually?
Which one is the best XMPP client library for PHP/javascript?
I have gone through many of these like:
JSJaC
XMPPHP
MISSUS
Kaazing Gateway
Some one having experience in using these will have better idea.
I have an html form whose action should be set dynamically throught javascript. How do i do it? Here is what i am trying to do:
<script type="text/javscript">
function get_action() { // inside script tags
return form_action;
}
</script>
<form action=get_action()>
...
</form>
I'm part of a testing team and have been tasked with "behaving badly" using javascript in a firefox browser. I've tried these methods to take the browser down http://www.yuki-onna.co.uk/browserdeath.html but none of them do anything worse than cause a popup asking to shut down the script.
Any other ideas?
I have a web page that includes a bunch of images.
Sometimes the image isn't available so a broken image is displayed in the clients browser.
How do I use jQuery to get the set of images, filter it to broken images then replace the src?
--I thought it would be easier to do this with Jquery, but It turned out much easier to just use a pure javascript solution. i.e the one provided by Prestaul
Does anyone know any good JavaScript alternatives to mxGraph (http://www.jgraph.com/mxgraph.html) that allows the user to draw Visio style diagrams on a canvas and add/edit/remove properties of elements?
Hi
This should be an easy one. I just cant figure it out.
How do I get the largest value from this piece of JSON with javascript.
{"data":{"one":21,"two":35,"three":24,"four":2,"five":18},"meta":{"title":"Happy with the service"}}
The key and value I need is:
"two":35
as it is the highest
thanks
Does JavaScript have a mascot, logo, insignia or otherwise stylistically engaging representation or alias? If not, who would be the best person/organization to get some momentum behind this kind of thing? Doug Crockford?
I have two javascript vars (they're coming from text boxes, so they're probably being evaluated as strings) in this format:
02:30 and 4:45
they represent hours and minutes.
I want to add them together to get 07:15 but I can't figure it out.
Hi
I am calculating yhe number of days between
from and to date
if from date is 13/04/2010 and the To date is 15/04/2010
The result must be 2 how to get the result using javascript
I am looking for a simple computer algebra system (cas) for JavaScript but I can't find anything with google. I only need basic functionality:
simplify expressions to some canonic form. Ability to check if two expressions are the same, i.e., a(x+y) == ax+ay
parse mathematical formulas. I want it to be able to read expressions like ax²+4x.
solve simple equations etc.
Do you know of such a library?
Basically, I have an iframe embedded in a page and the iframe has some javascript routines I need to invoke from the parent page.
Now the opposite is quite simple as you only need to call parent.functionName() but unfortunately I need exactly the opposite of that.
Please note that my problem is not changing the source url of the iframe, but invoking function defined in the iframe.
I need to create a custom volume slider for a WMP object. The current slider is complicated to modify, and use, is there a simple way to generate a slider on an HTML page that can have it's value passed to a javascript function?
I would like to know if it is technically possible to resize an image at a client-side with javascript (really resize, not just change width and height). I know it's possible to do it in flash but I would like to avoid it if possible. Is there any open source algorithm somewhere on the web?