JavaScript - jQuery - Ajax

Topics related to client-side programming language.
Post questions and answers about JavaScript, Ajax, or jQuery codes and scripts.

  1. » MarPlo
    Hello,
    How can I check if a Div is in viewport and detect when it exits viewport.
    Has anyone a code example or JS script that works in all browsers,...
    Last post » Admin
    Try the JavaScript script and example from this page:

    - It can be used to check if a html element is in viewport, and to get its size and top/left...


  2. » MarPlo
    Hello,
    How can I get the position top, left of a html element in page, for example a Div or an image?
    Also, how to get the size of a specified Div:...
    Last post » Admin
    This function, getBoxPS(), can be used to get the position and size (in pixels) of html elements in page.
    It returns an object with four properties:...


  3. » JanMolendijk
    I have this textarea
    <textarea name="details" rows="5" cols="50"...
    Last post » JanMolendijk
    Admin you thought off everything great work
    i added it & is working thanks


  4. » mlucicom
    hello! I have this page: elitservice.dk/contact-01.php
    When i press submit button i get an alert() with "parsererror".
    i test php code and...
    Last post » Admin
    Maybe from "functions.js", or ask the one who made the js scrips used in that page.


  5. » Marius
    How can I redirect the user from one page to another using jQuery?
    I saw both window.location = url; and window.location.href = url; How are they...
    Last post » Root13
    I think, it's better to use replace()


  6. » mluci12
    How can i get image who is choose on: autobelgia.ro/home.html
    At "SELECT VEHICLE TYPE " section?
    Last post » Admin
    I not know. You can post what code you have tried and what is not working in that code.


  7. » mluci12
    Hello,
    How can i get the value of this select live (mluci.com/d) a prefix number, and add in next input?
    Last post » Admin
    Hi
    See if this example helps you. The <select> element must have an "id".
    <select name="countryCode"...


  8. » dmgatwork
    I am looking for a JavaScript that will capture the browser name and version that is understandable. I want to determine if my viewers have older IE...
    Last post » Admin
    From what I know, you cannot get the user's ip with javascript unless you use ajax with a server side script or some kind of external service.


  9. » mluci12
    Hello!I want to make an webview in Javascript.I know that this is posibile but i dont know how can i do this.Please help me!
    Last post » Admin
    Hi,
    I not have experience with webview. From what I found on internet, it is an Android's class that allows you to display web pages as a part of...


  10. » WestJA
    Hi All, I'm new to the forum.

    my question is:
    can all html be done in javascript?

    the question has to do with parenting/siblings.
    Last post » Admin
    Hi WestJA,
    Welcome to this forum.
    You can set and add in the page the html code with javascript, you can build all the html code with javascript; but...


  11. » Marius
    Hello
    I use the following jQuery code to include a css file in html page, but it doesn't work.
    var fcss ='address/file.css';...
    Last post » Admin
    Hello
    To include a css file in html document, use the <link> tag (not <style>).
    You can use this javascript code:
    var fcss...


  12. » Marius
    Hello
    I want to make a calendar, but I don't know how to calculate the number of days in month, in any year.
    How can I get the number of days in any...
    Last post » Admin
    Hello
    You can use the daysInMonth() function from this example (month is 1 based):
    //Returns the number of days in a given month (1 - 12) and year...


  13. » mowgli
    Hello,
    I use the Fotorama script for a slideshow images. How can I put caption in some photo? How it is possible using this script?
    Thanks in...
    Last post » Admin
    Hi,
    I'm not the person who made the Fotorama script, and because I not use it, I not know very well about its customization.
    If you want to know more...


  14. » mowgli
    How to make a Fotorama different list of images for mobile and for desktop?
    For instance: desktop image 1, 2, 3 ... (1400x800) px. Mobile: 1a, 2a,3a...
    Last post » Admin
    I'm glad it works. I think it is not a problem that the slideshow starts from zero when the page rereshes, and anyway, the visitors not play with the...


  15. » Marius
    Hello
    How can I shuffle /randomize an array in JavaScript? Is there a JavaScript function like shuffle() in PHP?
    Last post » Admin
    Hi
    You can use this function:
    // receive an array and return it with the items shuffled /randomized
    function shuffle(ar){
    for(var j, x, i =...


  16. » crop
    Hi,
    i read this :

    and i tried to copy it, i made simplified version here:
    clinde.de/dump/crop.html

    - "check.php" is present, but you...
    Last post » MarPlo
    I replaced the "onblur" event with "onchange". Now, when ALL the input fields are validated, the submit button is enabled and the...


  17. » PloMar
    I have an Ajax function that adds in page some content from server. It was working fine when the page url was with "http", but after I put...
    Last post » MarPlo
    Hello,
    If the page url is with "https", the Ajax request must be made with "https". So, make sure you access the file on server...


  18. » PloMar
    I have this JS script:
    <script>
    function blockToggle(type,blockee,elem){
    var conf = confirm("Press OK to confirm the...
    Last post » MarPlo
    The error message indicates that there is not a HTML element in page with the id passed in the "elem" arguments.
    Check the part of your...


  19. » PloMar
    I have a dropdown select list like this:
    <select name="sel1" id="sel1">
    <option value="1">text...
    Last post » MarPlo
    Hi,
    You can use the selectedIndex property to get the ordered index of the selected option, then, with that index you can get the object with the...


  20. » PloMar
    Hello
    How can I get the filename and extension from a variale with an URL address in JavaScript?
    The URL can be any kind of webpage address; with or...
    Last post » MarPlo
    Hi,
    Just use the getFilename() function from this example:
    <script>
    function getFilename(url){
    // returns an object with {filename, ext} from...


  21. » PloMar
    Hello,
    Is it possible to display the content of a Div in full screen window with JavaScript?
    Last post » Admin
    Hi,
    There is fullscreen API in JavaScript, you can use the requestFullscreen() method to display a HTML element in full screen mode, documentation:...


  22. » PloMar
    Hello,
    I have the following code that sends form data with Ajax to a php script. It works, but after the form data is sent, the value added in the...
    Last post » Admin
    Hello,
    You can use the following JavaScript code (in the "success" section of your Ajax function) when the data have already been sent, to...


  23. » PloMar
    Hello
    I have the following code to send form data to a php script, with jQuery Ajax, withouut reloading the page.
    But, when I press the Submit button...
    Last post » Admin
    Hi,
    You have to call preventDefault() method to stop default action.
    <script>
    $(document).ready(function(){...


  24. » PloMar
    Hello,
    I want to display a file (image) in canvas before it is uploaded.
    The preview action in canvas should be executed all in the browser without...
    Last post » Admin
    Hi,
    You can use URL.createObjectURL() on the File from your <input> to generate a blob object URL.
    Generated URL will be like:...


  25. » PloMar
    Hello,
    I have a canvas element and a form with a text box and a button. I want to be able to put an image url into the text box, and after click on...
    Last post » Admin
    Hi,
    You can use this script. When click on the button, it adds the image from URL in page (into a Div, #pic1), then, the function addCnvImg() gets...