Search Results

Search found 23794 results on 952 pages for 'serverside javascript'.

Page 70/952 | < Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >

  • deleting files in javascript

    - by sasori
    is it possible to delete a file(s) inside the directory by just using javascript ?. what I currently have is, an index.php which displays the name of the files in the same directory and and a checkbox to each file name and at the bottom is a delete button. what I want to happen is, delete all the selected checkboxes once the delete button is clicked. I am not using mysql here, just a plain php file that displays the names. can someone show me how to delete the selected files using javascript ?

    Read the article

  • javascript call url from different domain

    - by user246114
    Hi, I want to post some data via javascript to another domain. Something like: http://www.othersite.com/submitfunnyname?name=blah The other site (othersite.com) has a REST interface that you can call (well actually this is a get example) to submit a funny name to them. Can I do this already with javascript? I'm a little confused on this - I know if that service wants to return some data, I'd need to use something like JSON-P - even though here I'm submitting some data, I guess the service will return some message structure letting me know the result, so it would have to be JSON-P, right? Thanks

    Read the article

  • Passing javascript to a function

    - by AJ
    Hello, Can I pass some Javascript to a function and then execute that Javascript from within the function, e.g. test("a = 1; b = 2; test2(a,b);"); function test(js) { // execute dynamically generated JS here. } Basically I have some code that is generated on the server and I want to pass that code to a JS function which when it has finished processing it executes the code passed as a parameter. This could also be useful for the parameter of setTimeout, then the code passed could be executed in the timeout event. Can this be done?

    Read the article

  • Disable (and re-enable) the href and onclick on elements

    - by jibees
    Hello I just want to enable / disable onclick and href on elements (a or div). I don't know how to do this. I can disable onclick by adding an handler on click event, but the href is still available. $(this).unbind().click(function(event){ event.preventDefault(); return; }); FOUND A HACK FOR A ELEMENTS if ($(this).attr("href")) { $(this).attr("x-href", $(this).attr("href")); $(this).removeAttr("href"); }

    Read the article

  • JavaScript: filter() for Objects

    - by AgileMeansDoAsLittleAsPossible
    ECMAScript 5 has the filter() prototype for Array types, but not Object types, if I understand correctly. How would I implement a filter() for Objects in JavaScript? Let's say I have this object: var foo = { bar: "Yes" }; And I want to write a filter() that works on Objects: Object.prototype.filter = function(predicate) { var result = {}; for (key in this) { if (this.hasOwnProperty(key) && !predicate(this[key])) { result[key] = this[key]; } } return result; }; This works when I use it in jsfiddle (http://jsfiddle.net/MPUnL/4/), but when I add it to my site that uses jQuery 1.5 and jQuery UI 1.8.9, I get JavaScript errors in FireBug.

    Read the article

  • Resize images to fit image control in asp.net javascript

    - by tszoro
    I change an image in the header based on which menu item is selected. The problem is that the image stretches in the image control. I want it to automatically zoom without distorting the image. Is this possible. Note: The images reside in an images folder and are not all the same size. Javascript <script type="text/javascript"> function ChangeProjectImage(imgpath) { var img1 = document.getElementById("Image2") img1.src = imgpath; } </script>

    Read the article

  • Algorithm of JavaScript "sort()" Function

    - by Knowledge Craving
    Recently when I was working with JavaScript "sort()" function, I found in one of the tutorials that this function does not sort the numbers properly. Instead to sort numbers, a function must be added that compares numbers, like the following code:- <script type="text/javascript"> function sortNumber(a,b) { return a - b; } var n = ["10", "5", "40", "25", "100", "1"]; document.write(n.sort(sortNumber)); </script> The output then comes as:- 1,5,10,25,40,100 Now what I didn't understand is that why is this occurring & can anybody please tell in details as to what type of algorithm is being used in this "sort()" function? This is because for any other language, I didn't find this problem where the function didn't sort the numbers correctly. Any help is greatly appreciated.

    Read the article

  • jQuery sparklines iterate over div

    - by ßee
    I have an array of divs and I want to iterate over each div and pass it to sparklines. like so: var divs = $("#wrapper>div"); var data = ["1:2:3:4", "4:3:2:3:1"]; var i; for(i = 0; i<data.length; i++){ divs[i].sparkline(data[i]); } I get the error "divs[i].sparkline" is not a function. But if I do this divs.sparkline([1,2,3,4]); its fine all the divs get the linegraph but with the same data. Does anyone have any suggestions but how to use sparkline when iterating over divs? Thanks!

    Read the article

  • JavaScript not working with Chrome & Xampp!

    - by Anonymous
    Hi, I've been trying for a couple hours now to figure out why JavaScript wouldn't work. The code works, but here it is anyway. <script type="text/javascript"> function change(text) { document.f1.ta.value="Hi!"; } </script> <form name="f1"> <input type="textarea" id="ta"/> <input type="button" action='change("Hi!")'/> </form> When I click the button, it does nothing. When I write "document.f1.ta.value="Hi!";" in the Chrome's inspector console, it works. I am using XAMPP (for Windows) 1.7.3 Windows 7 Ultimate.

    Read the article

  • Calling function from an object with event listener

    - by Mirat Can Bayrak
    i have a view model something like this: CANVAS = getElementById... RemixView = function(attrs) { this.model = attrs.model; this.dragging = false; this.init(); }; RemixView.prototype = { init: function() { CANVAS.addEventListener("click", this.handleClick); }, handleClick: function(ev) { var obj = this.getHoveredObject(ev); }, getHoveredObject: function(ev) {} ... ... } rv = new RemixView() the problem is my when clickHandler event fired, this object is being equal to CANVAS object, not RemixView. So i get error that says: this.getHoveredObject is not a function What is correct approach at that stuation?

    Read the article

  • Detect if the iframe content has loaded successfully.

    - by skinssay
    Hi, I have a widget that contains an iframe. The user can configure the url of this iframe, but if the url could not be loaded (it does not exists or the user does not have access to internet) then the iframe should failover to a default offline page. The question is, how can I detect if the iframe could be loaded or not? I tried subscribing to the 'load' event, and, if this event is not fired after some time then I failover, but this only works in Firefox, since IE and Chrome fires the 'load' event when the "Page Not Found" is displayed.

    Read the article

  • javascript toggle?

    - by MagentoM
    I have written this javascript <script type="text/javascript"> function toggle(user_id) { e=document.getElementById('toggleUserinfo_'+user_id); a=document.getElementById('displayUserinfo_'+user_id); if (e.style.display=='block') { e.style.display='none'; a.innerHTML='show'; } else { e.style.display='block'; a.innerHTML='hide'; } } </script> but its working fine on one page not working on other. The same file is used on both, any ideas?

    Read the article

  • How can I define a one-time event so that new handlers fire (once) even after the event has already occurred?

    - by harpo
    You know how this $(function() { ... }); will fire whether or not the "document ready" event has already occurred? I want to define an event like that. That event is a special case in jQuery. I'm wondering if a custom event can behave in the same way, using only the standard event mechanisms. Ideally, I'd like to be able to define handlers in the "normal" way: $(document).on("init.mything", function() { ... }); This works now if the above runs before init.mything is triggered. But if it doesn't, then the handler never runs. What makes this tricky is, I don't want to assume anything except that jQuery has loaded. Any ideas?

    Read the article

  • why are javascript functions like this

    - by Kajal
    I am a starter to javascript. I know to write JS userdefined functions. But recently I came across some thing that I can’t recognize. Can anyone explain to me what this is? (function( window, undefined ) { var jQuery = (function() { }); window.jQuery = window.$ = jQuery; })(window); What is the meaning of this? When I Google javascript functions I am getting only function foo(){ alert("This is an alert"); } I know to use these type of functions

    Read the article

  • How to perform .select() on jQuery masked text input

    - by dllhell
    I'm using http://digitalbush.com/projects/masked-input-plugin/ plugin. There is an input text with defined mask: <input type="text" id="txtMyInput" class="FocusSense"/> and a script: $(document).ready(function () { jQuery(function ($) { $("#txtMyInput").mask("?9.99"); }); $(".FocusSense").focus(function () { this.select(); }); }) As you can see, I would like select all in txtMyInput on focus but but alas! On focus, mask appears and loose .select(). What should I do to preserve mask and .select()?

    Read the article

  • Possible to use Javascript to access the client side's network(knowingly)

    - by Earlz
    I recently found an exploit in my router to basically give me root access. The catch? There is a nonce hidden form value that is randomly generated and must be sent in for it to work that makes it difficult to do "easily" So basically I'm wanting to do something like this in javascript: get http://192.168.1.254/blah use a regex or similar to extract the nonce value put the nonce value into a hidden field in the current page submit the form by POST to http://192.168.1.254/blah complete with the nonce value and other form values I want to send in. Is this at all possible using only HTML and Javascript? I'm open to things like "must save HTML file locally and then open", which I'm thinking is one way around the cross domain policy. But anyway, is this at all possible? I'm hoping for this to be able to run from at least Firefox and Chrome. The audience for this is those with some technical know how.

    Read the article

  • Do i need a hashtag in Javascript to pass as a Div

    - by Mike
    How do i insert this php DivSomething into Javascript? Since Javascript needs a hashtag to recognize that as a div. Is there a way to tell JS that this is a Div or there's other better way to do it? Any help would be very much appreciated. <script> /*How do i insert a var DivSomething into JS with a hashtag */ /* DivSomething is php dynamic. It returns a Div. It can be #Div1, #Div2, #Div3... */ var DivSomething = '<?php echo $Highlight; ?>' $(function() { $('#MouseHere').hover(function() { $('#' + DivSomething).css('background-color', '#ffffff'); }, function() { // on mouseout, reset the background colour $('#' + DivSomething).css('background-color', ''); </script>

    Read the article

  • Javascript - use to load xml data from URL

    - by spenf
    I have this url with some xml data in it: http://64.182.231.116/~spencerf/union_college/Upperclass_Sample_Menu.xml And I would like to load this xml data into my javascript script so I can parse it. I am using parse.com Javascript SDK, in there cloud code. Here is the code I have tried: Parse.Cloud.define("next", function(request, response) { response.success("Hello world!"); $.ajax({ url: 'http://64.182.231.116/~spencerf/union_college/Upperclass_Sample_Menu.xml', // name of file you want to parse dataType: "xml", // type of file you are trying to read success: parse, // name of the function to call upon success error: function(){alert("Error: Something went wrong");} }); }); But when I run this I get an error: $ is not defined at main.js:

    Read the article

< Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >