On making XMLHttpRequest to the server header("location:index.php") function not working?

I am using Ajax in my project so in header.php i am using Javascript code for sending the XMLHttpRequest to the server. I am including this header.php file in every page of the website. Problem is here that in signin.php page i am using header function. That is not working due to the Ajax code […]

Form inline Bootstrap with select and button WHMCS Domain Checker integration

I am trying to display a domain search field, with the select drop down menu and a search button. I am hoping someone can help me figure this out, it’s displaying differently in all 3 browsers (IE, Chrome and FF) http://docs.whmcs.com/Linking_to_WHMCS#Integration_a_Domain_Availability_Check_into_your_Website <form action=”X” method=”post” class=”form-inline” role=”form”> <div class=”form-group form-group-lg”> <div class=”row”> <div class=”col-md-6 text-right”> <input […]

Accessing httpservletRequest attribute in jquery/javascript

i am using Spring-MVC and posting data to the controller via ajax, and according to the business logic at controller i am returning different view. the place i am got stuck is, i want to differentiate between the what kind of view is returned by controller in jquery and as we cannot access server objects […]

How to hide div when browser resizes to less than 800px

Ok, so I am just starting to learn jquery, and I am in a stump. I have this javascript here that I am trying to get working: $(function(){ $(window).scroll(function() { if ($(this).scrollTop() > 890) { $(“.mobile-nav:hidden”).css(‘visibility’,’visible’); $(“.mobile-nav:hidden”).fadeIn(‘slow’); } else { $(“.mobile-nav:visible”).fadeOut(“slow”); } if ($(window).width() < 800) { $(‘.mobile-nav’).hide(); }; }); }); Basically what it is […]

How do you delegate events in hammer.js version 2.0?

In hammer.js v1.x (with jquery plugin) you could delegate events like this: $(‘ul’).hammer().on(“touch”, “li”, callback); With this syntax, you could attach the event listener to the ul instead of the individual li elements that you wanted to listen to. This would allow you to dynamically add li elements to the ul without reattaching event listeners. […]

Displaying form elements inline

I am following the tutorial from http://www.sitepoint.com/building-list-jquery-local-storage/ to build a todo list and i want to display for elements in the same line .At the moment form elements are stacked over each other and displayed vertically but i want them to be displayed vertically .I ultimately want to achieve a resilt that looks like this: […]

Jquery menu not show sub ul ifor mvc partial view

i’m try to use this sample for my menu : http://jqueryui.com/menu/#default my code: @model VirtualWebStore.Models.MainProductCategoryModel <script> $(document).ready(function () { $(“#menu”).menu(); }); </script> <div> <div class=” pull-right”> <ul id=”menu”> <li class=”ui-state-disabled”>MENU</li> @foreach (var item in Model.Categorylst) { <li> <a href=”#”> @Html.DisplayFor(x => item.CategoryName) </a> </li> foreach (var subtoCat in Model.CategoryToSub) { if (item.CategoryId == subtoCat.CategoryId) { […]

Jquery / Javascript scroll to div in page with only class element

I’m know you can scroll to different parts of a webpage using id and name elements, but I’ve got some different here. I’m using a WordPress theme from Croma called Dumanis and their div only offer classes, not Id’s. So I’m trying to figure a way to click on something in the navigation menu to […]

jquery $.when: how to trigger done callback even in case of error

Jquery’s $.when function executes the ‘done’ callback when all promises are resolved, but not if any of them result in errors. How do I execute the ‘done’ callback once all the promises have had a result, either success or error?   Asked By – tldr        Read Answers     0   

Writing a Python Plugin loader

I’ve adapted the code from http://lextoumbourou.com/blog/posts/dynamically-loading-modules-and-classes-in-python/ to python 3.4.1 and my needs. The outcome is this import pkgutil import os def run(): browse() def browse(): modules = pkgutil.iter_modules(path= [os.path.expanduser("~").replace("\\","/")+"/oyo/plugins"]) for loader, mod_name, ispkg in modules: load(mod_name) def get_class_name(mod_name): “””Return the class name from a plugin name””” output = “” # Split on the _ and […]

jQuery Resize function looping strangely

I have jQuery code to make accordion for page content when window width is resized 500px or less. When I use jQuery(window).load(function () { accordion works like it should. But when I use jQuery(window).resize(function () { or jQuery(window).on(“load resize”,function(e){ script is acting strangly and it loops (opens and closes accordion content). I need to use […]

Why does Symfony2 recommend avoiding use of legacy php sessions?

I have a web application built with standard PHP. I’m learning Symfony by building a sub-application (for administrators/owners of the site) using Symfony2. So far so good.. My symfony app does call some initialization code from the ‘parent’ application, and that initialization code sets some (legacy) session variables that this child application may or may […]

Panel not working in data-prefetch is used on the page

I’m using JQM for an web app and everything worked just fine, until I decided to prefetch two pages. <a href=”post.php?post_id=123″ class=”ui-btn-right” data-role=’button’ data-prefetch=”true” style=”position:fixed; top: 3px; right: 60px;”><i class=’fa fa-arrow-left’></i></a> <a href=’post.php?post_id=456′ class=”ui-btn-right” data-role=’button’ data-prefetch=”true” style=”position:fixed; top: 3px; right: 10px;”><i class=’fa fa-arrow-right’></i></a> If I remove data-prefetch=”true” from the two links, everything works just as […]

JS (or Jquery) on demand div gallery

I am searching for a really simple (div) gallery, so I am asking this question here because galleries (sliders mostly) on a Internet are full of unnecessary features/codes. Its really simple what I need. One main div (to show big image & text) and another set of divs (list – where I can gather thumbnails […]

JQuery Toggle Divs Based On Index not retoggle when clicked twice

and thank you for reading this question. Let me preface this by saying that I am not a programmer and only have tried to learn javascript to make my own websites look and function the way I want. I have a page with several hidden divs. I’m using elements with the same class and different […]

How to return jqgrid data of selected rows

In JQGrid var gridData=$(“#SearchResults”).jqGrid(‘getRowData’) The above line gives you the grid data of all the rows, is there a way where I can get the grid data of only the selected rows. selRowId = myGrid.jqGrid (‘getGridParam’, ‘selrow’), The above gives the selected row IDs but I want the data as well of all the selected […]

jQuery/CSS Mobile Icon Animation

I have incorporated a mobile icon into my personal website. http://www.farrfolio.com which can be found under 980px wide. The only problem is if I click the css animation twice fast the menu is collapsed showing the “x” instead of the “hamburger” icon. As you will notice I am using jQuery to activate the animation. Is […]

Load string from input to span

I am trying out some things and am wondering if you can pass the string/text from an input into a span element inside an h2 with JQuery. The HTML: <section class=”row”> <div class=”small-6 columns small-centered name”> <input name=”name” type=”text” id=”name-text” placeholder=”What’s your name?” autocomplete=”off” class=”text-center”> </div> </section> <section class=”row”> <div class=”small-6 columns small-centered name”> <input […]

jQuery if element hasClass of var do this

I want to display an element if it has a class equal to a variable but I can’t seem to get it working. My code: HTML: <a class=”addme” title=”showme” href=”javascript:void(0)”>hey</a> <div class=”list”> <div class=”hey”>hide</div> <div class=”hey showme”>show</div> <div class=”hey”>hide</div> </div> <span></span> JQUERY: $(function(){ $(‘div’).hide(); $(‘.addme’).click(function (e) { e.preventDefault(); var x = $(this).attr(‘title’); if ($(‘.hey’).hasClass(x)) { […]

Hide multiple span classes on image hover with jquery

I am trying to make an effect where when one hovers on an image a number of span classes, in this case named .highlight, fade out and then fade back in on mouse out. This is what I have so far: $(function() { var trigger = $(‘.imglist img’), target = $(‘.highlight’); trigger.hover(function() { target.fadeOut(‘slow’); }); […]

Not translating string properly?

In the following code, I have attempted to create a simple “translator” between a madeup language and English. If it worked properly, calling translate.toEnglish(“hopeloplopo”) would return hello Calling translate.toLanguage(“hello”) would return hopeloplopo Basically, I want it to replace each non vowel with the letter+op, and vice versa in toEnglish This is what currently happens: translate.toLanguage(“hello”) […]

Pass URL as a parameter to XSL

I’d like to pass current page URL as an attribute to XSL template. As far as I understood it should be passed as a parameter, and then used as an attribute. I use PHP to load XML & XSL files: <?php $xml = new DOMDocument; $xml->load(‘main.xml’); $xsl = new DOMDocument; $xsl->load(‘blocks/common.xsl’); $proc = new XSLTProcessor; […]

Session data duplicate storage for multiple hits

I can store the session data in database. But when the user clicks to store the session data again, the data is stored in database with new id generated. I have to ensure that the session data once stored in database should not be stored again. I am using servlets, jsp and hibernate. Using hibernate […]

Building GCC plugins on Mac OS X 10.9.4

I am trying to re-build a simple GCC plugin (which builds fine on GNU Linux). I am intending to compile the plugin using GNU GCC v4.6.3 which I have already installed under Mac OS X. The Makefile contents are given below: GCC=/Users/xxx/compilers/gcc-4.6.3/install/bin/gcc PLUGIN_SOURCE_FILES= plugin.c PLUGIN_OBJECT_FILES= $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES)) GCCPLUGINS_DIR= $(shell $(GCC) -print-file-name=plugin) CFLAGS+= -I$(GCCPLUGINS_DIR)/include -I/Users/xxx/compilers/gcc-4.6.3/install/include – […]

Regenerating a named cookie in a session

I am naming the default cookie set by express. But when I regenerate the session (due to server scaling), I need it to be regenerated too. How do I do that ? A simple code below: var express = require(‘express’); var session = require(‘express-session’); var cookieParser = require(‘cookie-parser’); var app = express(); //app.use(session({secret: ‘keyboard cat’})); […]

BIRT beforeOpen method gets new HttpSession object

I have a JEE web application (webapp1) with BIRT 3.7.1 integrated. We have few reports and one of the report params is hidden and the value is fetched implicitly from session object.This is done by using scripted dataset and below is the single line used to map the hidden input param of report to the […]

Is there any working example of sbt plugin which defined with AutoPlugin?

I see there is a AutoPlugin feature in sbt 0.13.5 version, and want to define a simple sbt plugin with it. But sadly, I followed the document(which is not in detail) also this question which is not actually resolved, without any lucky. Is there any working example I can try?   Asked By – Freewind […]

Where is `AutoImport` from the sbt document which can be used to create a sbt plugin?

From the document of sbt 0.13.5: http://www.scala-sbt.org/0.13.5/docs/Getting-Started/Using-Plugins.html, it mentions an AutoImport: Define another object that extends AutoImport. The contents of this object will be automatically imported in .sbt files, so ensure it only contains important API definitions and types. I have searched from sbt codebase carefully, but can’t find such a class. Do I miss […]

troubleshooting session expired using libcurl

I am trying to login to a website using libcurl in c (http website, not https). The problem is that after the login if I try to reach a page in the domain I get redirected to a page claiming my session has expired and I need to relog. I then assumed there must be […]

Aliasing prefixes (not namespaces) in XSLT

I want to change the prefix in the output from the prefix in the styleheet itself. XSLT file: <styleheet version=”1.0″ xmlns:a=”nsA”> <template match=”/”> <a:out/> </template> </styleheet> What I get: <a:out xmlns:a=”nsA” /> What I want: <b:out xmlns:b=”nsA” /> Note that I want to change only the prefix, not the namespace. The element namespace-alias will translate […]

Sessions wont stay after page refresh

i just upgraded to a new php version and it seems like the sessions wont work anymore, they register fine but after a page reload they dont work anymore, theyre gone.. Ive tried a lot of things, like session.save_path. my PHP: PHP Version 5.4.32 <?php session_start(); $_SESSION['test'] = 123; //when i remove this line and […]

How can i rewrite the URL (pointing to my plugin)?

I’ve recently started working on a wordpress-plugin. Now I’d like to make the plugin’s files accessible by a custom url. e.g.: The file that i need to access is ‘/wp-content/plugins/my-plugin/my-plugin-file.php’. Now, the special thing about my question: I do not want to access the file like this: http://myhomepage.net/wp-content/plugins/my-plugin/my-plugin-file.php?parameter=33333 I do wan’t to access it like […]

Max number of hosts in TCP session/ UDP session

For one session of 5 hosts with TCP how many more hosts can join? How many, if using UDP? TCP has point-to-point connection, so there can be only 2 hosts in one session, right? As for UDP, it is conectionless, so theoretically there is no limit! Am I right? Thank you!   Asked By – […]

Bitbucket plugin is not working on Android Studio 0.8.9

When I try to share my project on Bitbucket via plugin, Android Studio shows the error “Can’t publish part of repository”. The same error occurs with the official plugin version 1.2.1 and with this plugin: https://bitbucket.org/dmitry_cherkas/jetbrains-bitbucket-connector/downloads/jetbrains-bitbucket-connector_IC-135.1230.zip   Asked By – Exeller666        Read Answers     0   

scrollTo plug in, never in the same point

I’m using this scrollTo plug-in: http://demos.flesler.com/jquery/scrollTo/ And with only this simple code: $( document ).ready(function() { $.scrollTo($(‘#something’), {duration:2500}); }); I notice that every time I reload the page it scrolls in more o less the same position, but never in a specific(the same) point of the page. Sometimes a little bit up the #something id, […]

Is it possible to keep the Webview having same session from Parse SDK when the user is logged in using it

I’m building an new android app using parse.com Users can login to a parse app. This parse app has hosting web page showing user’s contents. I want to show the webpage using an Webview. so the webview need to login or share the session from Parse SDK automatically. I used to develop this feature by […]

Why Prestashop doesnt use $_SESSION for session storage?

I noticed that Prestashop 1.5 doesn’t use $_SESSION(I’m not sure whether other versions take same approach) anywhere in its core to store session data. I’m so curious to find out why the Prestashop developers took such a strong decision against $_SESSION, and what was the design concerns that lead to this decision. Does it give […]

Ratchet Session Data Syncronisation using memcache

I created a Ratchet Web Socket Server and tried to use SESSIONS. In my php file on the HTTP-Webserver (Port 80) I set the session-data like this use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; use Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcacheSessionHandler; $memcache = new Memcache; $memcache->connect(‘localhost’, 11211); $storage = new NativeSessionStorage(array(), new MemcacheSessionHandler($memcache)); $session = new Session($storage); $session->start(); $session->set(‘uname’, $uname); and connected to […]

undetected resolution with 14.04

I am an utterly starter but need to change from Vista to Linux with my pc: Epson NJ2100(WXZA wide scren of 5:3). According to the manual of virtualbox, I have used cvt/xrandr commands for guestaddtions to finally get such an error message below: X Error of failed request: BadMatch(invalid parameter attributes) Major opcode of failed […]

how to run a remote Enterprise Client Application without ant

In Netbeans, I clicked an Enterprise Application Client, added a few source code files and a jndi.properties file. It runs with the expected output, just echoing the properties file to the console. How would I deploy this application onto a different computer? This application is intended to invoke an EJB remotely. At the moment, I’m […]

How to remove a product from cart and how can i add multiple products to pay pal with this script?

<?php if (!isset($_SESSION['cart']) || (count($_SESSION['cart']) == 0)) { echo ‘<p>Your cart is woefully empty.</p>'; } else { echo ‘<table border=”0″ cellspacing=”0″ cellpadding=”0″ align=”center” class=”prodet”> <tr><td>Item</td><td>Price</td><td>Qty</td><td>Amount</td></tr>'; $total = 0; //We iterate over all the items in $_SESSION['cart']. //Each item represents a “row,” or a single product to buy, in the shopping cart. foreach($_SESSION['cart'] as $item) { […]

requests module – trying to post

I’m using the requests module with python 3.3 and am trying to post data. This is the data I’m trying to post. I’ve already parsed the values from the html: <form name=”login_form” action=”/checkoutnow/2″ method=”post” class=”proceed” novalidate=”novalidate” autocomplete=”off” id=”loginForm”> <input type=”hidden” name=”execution” value=”e21s1″ id=”loginForm” /> <input type=”hidden” name=”token” value=”EC-2MJ027776Y1687721″ /> <input type=”hidden” name=”incontext” value=”0″ id=”incontext” /> […]

POSTing a multidimensional array from Python

I’m trying to POST an array to a RESTful PHP API. The idea is to allow (n>0) records, each containing a remote_id, a dimension_id and a metric. Here’s my client Python: data = urllib.urlencode([ ("remote_id", 1), ("dimension_id", 1), ("metric",metric1), ("remote_id", 1), ("dimension_id", 2), ("metric",metric2) ]) response = urllib2.urlopen(url=url, data=data) And here’s my serverside PHP <?php […]

Maintain login session in android app

Whenever user login from android updating status of user at php server( i.e set status =1 ) and set status =0 when user logout from app. Now other usres will see in their app the user as logged in when status =1 . But when user uninstall application while he is logged in and install […]

trying to kill a codeigniter session using another controller

Working on a project based in CodeIgniter. In my user menu, I use the code <?php if (isset($username)) echo ‘<li class=”right” style=”float: right;”><a href=”‘.site_url().’logout/”>Logout</a></li> ‘; ?> which shows causes a logout button to appear if the username variable is set. This takes them to the logout.php controller, which reads as follows: <?php if ( ! […]

codeigniter sessions not carrying from page to page

Is anyone here familiar with CodeIgniter sessions? I have a login script which is functional. On a successful login, a session is created. A user is redirected to thier home page. The new page should show thier username as it was stored in the session variables, but shows nothing at all. The code from the […]

Phonegap App not including javascript files

Javascript files are not being pulled into my Phonegap app. This is a recent problem that is quite frankly driving me insane. This is the top of my index.html file: <link rel=”styleheet” href=”http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css”> <link rel=”styleheet” type=”text/css” href=”css/index.css” /> <title>Hello World</title> <script type=”text/javascript” src=”cordova.js”></script> <script type=”text/javascript” src=”https://maps.googleapis.com/maps/api/js?key=AIzaSyD90W6MypWGP6s4luD2kQHhZ9IFQrfr04g&sensor=true”></script> <script src=”https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=visualization”></script> <script src=”http://code.jquery.com/jquery-1.9.1.min.js”></script> <script src=”http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js”></script> <script type=”text/javascript” src=”js/index.js”></script> […]

PS Old Gen memory in Heap Memory Usage: GC settings

Below are my JVM settings: JAVA_OPTS=-server -Xms2G -Xmx2G -XX:MaxPermSize=512M -Dsun.rmi.dgc.client.gcInterval=1200000 -Dsun.rmi.dgc.server.gcInterval=1200000 -XX:+UseParallelOldGC -XX:ParallelGCThreads=2 -XX:+UseCompressedOops -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jbos88,server=y,suspend=n Problem: Total Heap Memory: 2GB Old Gen: 1.4GB (2/3 of Heap) New Gen: 600MB(1/3 of Heap) The Old Gen grows in memory beyond 70% 0f its allocated size and never is subjected to GC even at 100% i.e 1.4GB. […]

Resource interpreted as Document but transferred with MIME type image/gif: "https://www.facebook.com/tr/". fbds.js:10

When I use the below facebook conversion code in a website A, I am getting a truncated URL “https://www.facebook.com/tr” in the network request with a message from Facebook(fbds.js). The URL should be a full URL with all the params in place as given in expected section below. Message: Resource interpreted as Document but transferred with […]

« Previous PageNext Page »