w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
JavaScript code sent Date to PHP page Not working
You're concatenting it wrong. The & must be within quotes. and you're also missing the concat operator (+) at places Yours : data: "ch=" + dropdown&"ch2=" + dropdown2&"ch3=" + dropdown3 Correct : data: "ch=" + dropdown + "&ch2=" + dropdown2 + "&ch3=" + dropdown3 And dropdown, dropdown2, dropdown3 values won't work the way they are. It must be selected from the element, like this : data: "ch=" + $("#dropdown").val()+"&ch2=" + $("#dropdown2").val()+"&ch3=" + $("#dropdown3").val() And remove the onclick to use jQuery's click : $("input[type=button]").on("click", function dynamic_Select() { $.ajax({ type: "GET", url: 'att-filt.php', data: "ch=" + dropdown + "&ch2=" + dropdown2 + "&ch3=" + dropdown3, dataType: "h

Categories : Javascript

If condition not working in HTML page with C# code
You need to start with @... @foreach (Message userMessage in UserMessages) { and... @if(userMessage.Message.MessageText.Length <= 10) { Without it at the start, the if( is still treated as HTML. The @ symbol identifies the start of your Razor syntax (i.e. C# code) and will continue to be a razor code block until an appropriate terminator has been reached. There are a number of ways to move it back to HTML, the one most commonly seen in your example is to include a html tag, such as <td>. Here is the complete version of your code, hopefully it will help you understand how it should work: <table> //due to the table tag, we are current inside HTML //so we need to use the @ symbol to move back to razor syntax @foreach (Message userMessage in UserMessages) {

Categories : C#

button enable not working on code behind on aspx page
try this: i think this will work... protected void btnSubmit_Click(object sender, EventArgs e) { if (Page.IsValid) { btnSubmit.disabled= true; btnNext.disabled= false; } or you can also try: btnSubmit.Attributes["disabled"] = "disabled"; hope this will help you.

Categories : Asp Net

My simple code of jQuery is not working. I get a blank page when I run it
you have html mark up in script element also you need to bind the event click <html> <head> <script type = "text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"> </script> </head> <body> <div id = "myElement"> <input id = "click" type = "button" value = "Click"/> </div> <script type = "text/javascript"> $(document).ready(function() { function sayHello(){ alert("Hello jQuery"); } //$("#click").bind("click", sayHello); // the event is called click not bind $("#click").on("click", sayHello); // on is the preferred way to register event handler });

Categories : Javascript

Magento module custom block working in product details page but not working in list and grid page?
Well, The xml code which you are using in the category page ( list page) is not correct. It should be like this : <catalog_category_default> <reference name="category.products"> <block type="test/test" name="test" as="other" template="test/test.phtml" > <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" /> </block> </reference></catalog_category_default> <catalog_category_layered> <reference name="category.products"> <block type="test/test" name="test" as="other" template="test/test.phtml" > <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" /> </block> </reference> </catalog_category_layered> Please try wi

Categories : PHP

magento jquery toggle not working in home page but working in product page
Open up your Chromium-Browser and your console https://developers.google.com/chrome-developer-tools/docs/console#opening_the_console Type jQuery into the console and press enter If you get: ReferenceError: jQuery is not defined then you have not included jQuery Post any errors you get in your console after refreshing the page...

Categories : Javascript

how to run method in master page before execute child page code in IsPostBack?
You need to have a look at the ASP.NET Webforms page lifecycle in order to understand what happens when. Here is some docs regarding that: http://msdn.microsoft.com/en-us/library/ms178472(v=vs.100).aspx#lifecycle_events The problem you have at the moment is that the Button click event happens after the Page_Load event, so when you click the button you probably experience that Label1.Text is one click "behind". Look at the docs and place the Label1.Text assignment in PreRender for example. Like @ArabicProgrammer is answering, it is better yet to actually make use of the Culture support that is available in the .NET Framework. If you use that method instead, you can display the language using something like this. <%= System.Threading.Thread.CurrentThread.CurrentCulture.DisplayName %

Categories : C#

Unicode signs shown on development page, but not on actual page with same code
Try putting this in your <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> Also, try changing the de-DE in the <html> tag to <html lang="de" prefix="og: http://ogp.me/ns#"> let me know if that works

Categories : CSS

AJAX code for calling code-behind method from aspx page doesn't work
try this: in your anchor do this: <a href="javascript:void(0)" id="kontakt">Go to Kontakt</a> and modify your ajax script to this: $('a').click(function (e) { var data = { 'id': $(this).attr("id") }; var dataVal = JSON.stringify(data); $.ajax({ type: "POST", url: "Default.aspx/loadNewPage", contentType: "application/json; charset=utf-8", data: dataVal, dataType: "json", success: function (id) { } }); });

Categories : Javascript

Adding JavaScript Code to A Single Page in Joomla (Google Remarketing Code)
You could use a module which allows to run custom code in it. There are several solutions to this in the JED: http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-modules

Categories : Javascript

node.js page in different tabs shows the same page source code
Yes, it's because your browser caches page sources and when you are trying to view it, shows the latest loaded page. If you add some logging, you'll understand what i mean. http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.write('<p>' + Math.random() + '</p>'); res.end(); console.log('Message has been sent'); }).listen(3000); When you open your page in new tab, you can see in console that browser loads new version of it. But when you trying to view the source browser doesn't load anything. If you want to avoid this behaviour, try to reload the source, after you open it.

Categories : Node Js

generate code using form button and then display generated code on page
You can use tag to show HTML entities You need to encode all Your HTML entities like < => < like way. Also you can show a text area in which all those HTML code need to echo, it will not execute your code simply it will print it.

Categories : PHP

How to get source code after simulate web page button click in code
A hacky approach would be to: Attach an event handler to the 'onclick' event of the button. Then, once the event is triggered, use the Microsoft Internet Controls (SHDocVw) type library in order to get the last URL opened in IE. Lastly, navigate to the URL and once the document is loaded, get the source of the document from the webBrowser1.DocumentText property. In your project, add a reference to the Microsoft Internet Controls type library (you'll find it in the COM tab). Add at the top of your file: using SHDocVw; The code: webBrowser1.Navigate(url); while (webBrowser1.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); } // assign the button to a variable var button = webBrowser1.Document.GetElementById("downloadButton"); // attach an event handler for

Categories : C#

C# Code only getting pagesource for visible page, not for scrolled down page
using HtmlAgilityPack; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication5 { class Program { static void Main(string[] args) { WebClient wc = new WebClient(); var sourceCode = wc.DownloadString("http://dota-trade.com/equipment?order=name"); HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(sourceCode); var node = doc.DocumentNode; var nodes = node.SelectNodes("//a"); List<string> links = new List<string>(); foreach (var item in nodes) { var link = item.Attributes["href"].Value; links.Add(link.Contains("h

Categories : C#

insert html code to a page via php script in other page
As Filippo Toso said, you may include the HTML file in your code.php. Perhaps, if you don't want to have two files, you may make only one file and set the form to act like that: <form id="createNewGallery" name="newgallery" method="GET" action="./"><p><strong>please choose the number of pictures you want to upload: </strong> <select name="numOfPictures" id="numOfPictures"> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> </select></p> <input name="submitNumOfPictures" type="submit" /> <

Categories : PHP

Javascript not working in php project and user is still getting routed to php page instead of holding at current page
What you need to do is prevent the default action. Change $("button#submit").click( function() { to $("button#submit").click( function(event) { event.preventDefault(); Also you are explicitly calling the submit function here: $("#myForm").submit(function() { return false; }); Try removing this code as well, it is likely resolving prior to the $.post call finishes Lastly your jquery code should be wrapped in a document.ready block ... $(document).ready(function(){ $("button#submit").click(function(event) { event.preventDefault(); if ($("#username").val() == "" || $("#password").val() == "") $("div#ack").html("Please enter both username and password"); else $.post($("#myForm").attr("action")

Categories : PHP

Login page with Spring Security not working URL(http://localhost:8080/site/j_spring_security_check) goes to PAGE NOT FOUND
You've been answered here and here, please don't cross-post The answers: if the j_spring_security_check URL is not part of the HST driven then make sure you add it to you hst:hosts exclusions, because otherwise the HST thinks it needs to handle the URL. and You need to insert the​ SpringSecurityValve into your existing pipelines​ as well​. ​you can use the hippo-spring-sec​ plugin for a cleaner spring security integration; http://hst-springsec.forge.onehippo.org/

Categories : Spring

Replace near working array code with hash code in ruby to find mode
This seems to fit your requirements: def mode(array) histogram = array.each_with_object(Hash.new(0)) do |element, histogram| histogram[element] += 1 end most_frequent = histogram.delete_if do |element, frequency| frequency < histogram.values.max end most_frequent.keys.reduce(&:+) / most_frequent.size.to_f end It creates a hash of frequencies histogram, where the keys are the elements of the input array and the values are the frequency of that element in the array. Then, it removes all but the most frequent elements. Finally, it averages the remaining keys.

Categories : Ruby

The following code is working in eclipse but when i convert into maven project this code giving error
i check your pom.xml and code this problem will comes only the mismatch the version json-lib-0.9 and json-lib-2.4 or other version of library so you remove all library and try the following way and one more things you have to remove from json-lib from apche-tomacat lib also and then you try this following code and used the json-lib 2.4 version. String user1 = "{'Main':[{'h1':[ {'userId':'userId123'} ],'body':[{'data': [{'userId':'one'}]}] }]}"; JSONObject jsonObj = (JSONObject) JSONSerializer.toJSON(user1); JSONArray snefoCareEnvelopeMain = (jsonObj.getJSONArray("Main")); //main object JSONObject Main = snefoCareEnvelopeMain.getJSONObject(0); // this for reading h1 data JSONArray headerarray = (Main.getJSONArray("h1")); JSONObject

Categories : Java

Error Code: 1289. The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; to have it working
It's by design. SHOW PROCEDURE CODE Syntax This statement is a MySQL extension that is available only for servers that have been built with debugging support. It displays a representation of the internal implementation of the named stored procedure. As the error message explicitly says if you want to be able to use this feature you need to build your MySql with --with-debug option.

Categories : Mysql

Page reload not working when the page was called by AJAX
Try this <?php $var = $_GET['id']; if(empty($var)) { // here flag for redirection is set echo 1; } else { do something... } ?> In AJAX: $.ajax({ type: "POST", url: "call_me.php", data: "id=" + id, success: function(msg){ // checking the response is for redirection if(msg == 1) // javascript code for redirecting to callme.php window.location = "call_me.php?id=101"; } });

Categories : PHP

Bootstrap Popover not working when code hosted locally, but working on jsbin
I had a similar issue a long time ago. Here's how i solved it: i changed the order of my imported .css and .js files. Try to load first bootstrap's required files and then everything else. Hopefully it will work for you too! if not then there's something wrong with your code.

Categories : Javascript

My code is working in c++ exclusively but the same code will not work from within Node.js
It's a wild guess since no code has been provided but is it possible that v8 code is being executed in another thread (different from the main)? For example, some callback invoked on successful connection that makes calls to node/v8 functions (I assume those external libraries you mention start their own threads to do their work). If that's the case, the problem is that node/v8 code can only be invoked from the main thread. Those SO threads might be useful: Calling callback from node.js native code Callback from different thread in NodeJS Native extension As for debugging, except from examining a core, you could also run your code with gdb so you can set breakpoints at some interesting places. $ gdb node (gdb) run test_connection.js or (gdb) start test_connection.js (gdb)

Categories : Javascript

PHP-MySQLi Prepared Statement not working in code but working is PHPMyAdmin
A prepared statement would look like this SELECT `id` FROM `registgrations` WHERE `email` = :email AND `license_type` = :license_type Checkout the PDO manual docs to learn how to use it. http://php.net/manual/en/class.pdostatement.php

Categories : PHP

Jquery code not working on mobile device but working in browser
Since you're using jQuery Mobile, try using vclick rather than click. http://api.jquerymobile.com/vclick vclick will work with both touch events and mouse click events, whereas click only deals with actual click events - which can be finicky on a mobile device (and sometimes not fire at all when tapping on things). UPDATE: some questions/feedback: why do you have a click event on a form? $('#choosefriendsform').click(function() { That doesn't look right to me... Click events should be on buttons, or clickable elements. This could be the source of your issue. If you're trying to do event delegation on the form, then you need to use 'on' or 'delegate' I.e. this should target just the list items of peoples names: $('#choosefriendsform').on('vclick', '.ui-listview .ui-li', function

Categories : Jquery

'.contains' is not working in android phones but its working fine in web page
Use this Polyfill, ( Reference : MDN) if(!('contains' in String.prototype)) { String.prototype.contains = function(str, startIndex) { return -1 !== String.prototype.indexOf.call(this, str, startIndex); }; } See the Compatibility table in Can I use... Update : Also you can check this answer.

Categories : Javascript

using jQuery $(this).addClass not working, simple code not working
You didn't ever close your <a>, but it's working for me otherwise. http://jsfiddle.net/L3nyE/ <ul> <li><a href="#">List Item 1</a></li> <li><a href="#">List Item 2</a></li> <li><a href="#">List Item 3</a></li> <li><a href="#">List Item 4</a></li> </ul> CSS: .on { background-color:red; } jQuery: $('a').click(function(){ //alert('on'); WORKING $(this).addClass('on'); });

Categories : Javascript

Code not working when running normally, but working in debug (eclipse)
I had the same Problem, but with some more specification. The code was working fine in 32bit but I had this issue in 64bit (I am using native library so I need to maintain both). The solution I found is to add Thread.sleep() in the while loop. I don't know why it works, so your guess is as good as mine. A better solution would probably to implement an Observer Pattern instead of having an infinite loop. But that would require some re-factoring.

Categories : Java

 will not display the page - will not let me see the page
Your problems is most likely that TinyMCE escapes all HTML tags. To allow code to be embedded without adding the security risk of allowing other HTML tags to be inserted, I think this is what you want: https://code.google.com/p/tinymce-pre-plugin/

Categories : Javascript

Google Analytics - event tracking code in separate