w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Using server-side includes, what are options for selecting a current nav element?
You can first look at the url to detect the page name, then you can match the page name to classes you define on your LIs. if(document.location.href.indexOf('index')>-1) { $('li.index').addClass('active') } You can also do this with the page title instead if you wish, instead of the url. Another trick is to add a class to the BODY tag, per page, and let CSS do the work: body.index li.index { background-color:#FF0000 } body.aboutus li.aboutus { .... whatever }

Categories : Javascript

how to stop refreshing of current page when any server side event of web user control being fired
UpdatePanel enables sections of a page to be partially rendered without a postback. You can have a full understanding by reading here. -EDIT- I don't if this will help but you gotta try this: Check if is set in your web.config, if it is there you may want to remove it. Go to this link for more details. Hope it helps!

Categories : Asp Net

How do I have a page display new information in Sinatra after a server-side process ends?
In order to use AJAX you have to create an endpoint on your server and use a jQuery or another framework to ease the use of calling the endpoint from javascript. I will paste a short example. The server could look like this: require 'sinatra' set :views, "." get '/' do erb :home end get '/ajax_endpoint' do t1 = Thread.new { sleep 10 } 'Done' #do the job end Put in the views folder (in my case the same as the one the main sinatra app is in) a file with the following content: <html> <script src='http://code.jquery.com/jquery-2.0.3.min.js'></script> <script> window.onload = function() { $.get('/ajax_endpoint', function(data) {$("#the_div").text("Job done!")}) } </script> <body> <div id='the_div'> Loa

Categories : Ruby

Server-side equivalent of IE setting "Check for newer version of stored page"
You failed to set the proper headers to prevent caching. What exactly did you try, and what were the headers in question (look with Fiddler). In this article, I explain how IE's "Check for new versions" feature works, and as I say there: The most important fact to keep in mind is that these four options impact the behavior when there are no caching headers on the HTTP responses; when caching headers are present, Internet Explorer will always respect them.

Categories : Dotnet

jQuery mobile stop running the script in the current page used after moving to the next page
As, Omar suggested I want to give an id instead of $(document). Using pagebeforeshow or pageshow , pagehide and Clearing the interval will solve this issue. The following code works for me, var auto_refresh; $("#light-page").on('pagebeforeshow', function(){ auto_refresh = setInterval(function () { // code }, 3000); }); $('#light-page').on('pagehide', function () { clearInterval(auto_refresh); }); Adding id in Html: <div data-role="page" id="light-page"> </div>

Categories : Javascript

load part of page when cash page in server side
you need to add AJAX request that will run once on document-ready to get rating from PHP page and update the rating $(document).ready( function(){ $('#productvote-20').load('Rating.php?productId=1'); }) And in that PHP file, you need to output this.. but don't cache that page <input type='checkbox' name='vote' value='1' /> <input type='checkbox' name='vote' value='2' /> <input type='checkbox' name='vote' value='3' /> <input type='checkbox' name='vote' value='4' /> <input type='checkbox' name='vote' value='5' />

Categories : PHP

Getting "A page can have only one server-side Form tag" error, not using a master page
After adding one control you have a form with runat="server" tag: <form id="Form1" runat="server"> <asp:Menu ID="StockMenu" runat="server"> You already mentioned you have 16 usercontrol in one page. So you have 16 forms with runat="server" tag. Which is not allowed. Solution: As Chris Lively suggested, strip out the the form tag from your wsercontrols. Add just one form tag in the page. You should be ok. Here's how should all your controls should look like: <asp:Menu ID="Menu1" runat="server"> <Items> <asp:MenuItem Text="One Day" /> <asp:MenuItem Text="Five Days" /> <asp:MenuItem Text="Three Months" /> <asp:MenuItem Text="Six Months" /> <asp:MenuItem Text="One Year" /> </Ite

Categories : Asp Net

Is it possible yet to make a single page web page without using server side such as PHP?
Client side javascript can know about the query string on a URL. In javascript, it can be accessed through location.search. You could have your javscript show and hide different sections of the page based on the information in the query string.

Categories : PHP

asp.net page wait others server side / asynchrone page
WebForms are not ideal for asynchronous operations. Add SignalR to your project and use a Hub to push status data back to your page to update the current state of the process you are running Asynchronously. An example of a technique to perform this type of asynchronous notification is covered in my blog post titled "A Guide to using ASP.Net SignalR with RadNotifications"

Categories : Asp Net

How to display tiles in my home page
If you are willing to pay some bucks you could try the TreeMap control which is inside the Syncfusion Essential Fusion for Windows Phone.

Categories : C#

how to display different database value in jsp page table side by side
You are doing the while loop before the table tag, so you are defining two tables, just move the while loop inside the table before the tr tag ResultSet rs=st.executeQuery(sql); <TABLE border="0" width="900"> <% while(rs.next()) { %> <tr valign="top"> <td width="300" ALIGN=left> <div class="item_list"> <iframe src = '<%=rs.getString("link") %>' frameborder = 0 height=250></iframe> <input type="hidden" name="keyword" value="<%=rs.getString("keyword") %>" /> </div> </td> <td width="300" ALIGN=left> <div class="item_list"> <iframe src = "here i need different table value" frameborder = 0 height=250> </iframe> <input typ

Categories : Jsp

Single Post display in wordpress on home page
Create a page instead of a post and configure Wordpress to use that page as the home page (the setting for the assignment is here: /wp-admin/options-reading.php). You can then assign a custom template to that page and it will always be the page users see first when they come to front door of the site. Will there be different posts that will appear on this front page? You can always create a custom query in the page template to grab the most recent post in the 'sticky' category, or by whatever criteria you're using.

Categories : Wordpress

client side and server side page generation
From my experience, there are two scenarios in which you'd want to render client-side: You are building a pure client-side JS application. You want to serve the data for different platforms (web, desktop, mobile native). Unless you identify your page with one of the previous scenarios (which I assume you don't), I recommend you to render in server side. Although the response is going to be bigger (server side computing time is negligible), the perceived speed compared to client side rendering is going to be faster. If you need to serve a very big page, note that you could autoload chunks of HTML via AJAX whenever the user reaches the bottom of the page without the need of client side templates.

Categories : Javascript

How to refresh a home page or go to the home page with one link?
I'm not exactly sure if this is what your question is asking but if you want to go to the home page, just set the link to <a href="/" title="Home Page">Home Page</a> On every single page. No need for Javascript, just straight up HTML.

Categories : Javascript

Confirm before: close the current page, change the url, leave the current 'page'
Within var app = $.sammy(function() {...}); add the following: // Will run at #/route but not at #/ this.before('#/route', function() { if(!window.confirm('Are you sure you want to leave this page?')) { return false; } }); // will run at #/ but not at #/route this.before({except: {path: '#/route'}}, function() { if(!window.confirm('Are you sure you want to leave the home page?')) { return false; } }); Source: Sammy.Application before ( options, callback )

Categories : Knockout Js

Check current image being displayed on page
This might not be a perfect solution, but if you are already using sessions you could set a session variable when selecting the image to show to the user, and then fetch it when you want to know which image is being displayed. You have to remember though, that if the user has multiple windows open there is no guarantee that this works.

Categories : PHP

How to check if current facebook user like a page using PHP SDK?
You can use FQL $isFan = $facebook->api(array( "method" => "fql.query", "query" => "SELECT uid FROM page_fan WHERE page_id = '<YOUR PAGE ID>' AND uid = '<UID>" ));

Categories : PHP

How to make python server auto redirect to home page instead of giving file list?
So you want to build a simple web application? Have you looked into using a tiny framework like Flask to help you do this? With Flask, what you want is only a few lines of code :) Create a file named app.py from flask import Flask, render_template app = Flask(__name__) @app.route('/') def index(): return render_template('front/home.html') if __name__ = '__main__': app.run() And you could run this with python app.py And access it via the default location of http://localhost:5000 Cool, no?

Categories : Python

Using server side includes or ssi ,AWS S3
Amazon S3 does not support SSI. All content hosted on S3 is static content. You could process the files locally before you upload them to S3 and handle any code includes. Then, once you have the final version, just upload that to S3.

Categories : Amazon

How to display sister pages of current page
If what you want is to display only the siblings of the page you can try this. $parent = $post->post_parent; wp_list_pages(array( 'depth'=>1, //displays only the top depth 'exclude'=>$parent, //Exclude the parent page from showing up in the list. )); You'll need to create some conditional statements for child pages to display their sibling pages,but this should at least get you going. By specifying which ID to include in the page list it should output a list for you. Also, you can refer to the wp_list_pages codex for detailed description on how it works :) EDIT: Tested the above and fixed an element that wasn't working. It should now work to display only the sibling pages

Categories : PHP

Database driven PHP menu with check for current page
You have php tags in your echo statement in your first example echo " <li><a href="" . NEWS_URL . "?show=news&amp;action=show&amp;id=" . $row['id'] . "" <?php if( $_SERVER['REQUEST_URI'] == "$this" ) echo " class="selected""; ?>>" . stripslashes( $row['title'] ) . "</a></li> "; try this echo " <li><a href="".NEWS_URL."?show=news&amp;action=show&amp;id=".$row['id']."". ($_SERVER['REQUEST_URI'] == $this ?"class="selected"" :"").stripslashes( $row['title'] )."</a></li> ";

Categories : PHP

how to display a coming soon page when a page doesn't have an index page using htaccess
I'm guessing that for http://domain1.com/, you've got the document root pointed to /domain1.com/, which means it will never be able to access files outside of the document root. You'll need to move the comingsoon.php file to the /domain1.com/ folder and include the same ErrorDocument. Another option is to include the full hostname in the original error document: ErrorDocument 403 http://maindomain.com/comingsoon.php But this will change the location in the browser's address bar.

Categories : Htaccess

Server Side Includes with variable (IIS 7)
By the extension I guess you would use Classic ASP. Then something like this should work: <!--#include file="header.asp"--> You can put this in each file you want to have a header. Of couse, you should create that "header.asp" page first ;) For highligthing the tab of the page you're in, there're several methods. IMHO, I suggest a clientside script to do that. JS or jQuery of course. You could check the file name of the URL you are in and give the proper class to the tab so it will be highligthed. Example ( jQuery needed ): var currentPage = window.location.pathname.substring(url.lastIndexOf('/')+1); if(currentPage == 'default.asp') $('li.homepage a').addClass('current'); This simple code retrives the file name and, by it, add a class to the corresponding element in your na

Categories : HTML

My Server Side Validation in PHP Comes when the Page is loaded
Are you using GET or POST to submit your form data? If you're using POST, you can check the request method: if($_SERVER['REQUEST_METHOD'] == 'POST') { // Validate form data } else { // Display form } If you're using GET you should check if any of the data you need is set. For example: if(isset($_GET["arg1"]) || isset($_GET["arg2"]) || isset($_GET["arg3"]) || ...) { // Validate data } else { // Display form }

Categories : PHP

Detect and display current page as marked link
Instead of checking which script is running, check $_SERVER['REQUEST_URI']. This will give you the relative URL as requested by the client.

Categories : PHP

How to display sub domain posts in main domain home page on wordpress?
Try adding this to an appropriate place in your .htaccess file located in Root folder of your site : RewriteEngine On RewriteCond %{HTTP_HOST} ^(.+).domain.com$ [NC] RewriteRule ^ http://domain.com/ [L,R] To exclude www subdomain , www.domain.com, add this line before the RewriteRule: RewriteCond %{HTTP_HOST} !^www.mydomain.com$ [NC]

Categories : PHP

Use web.config to allow server-side includes in HTML files (IIS)
Presuming that your hoster has enabled SSI's and delegated Read/Write permissions for handler mappings then this should work: <configuration> <system.webServer> <handlers> <add name="SSINC-html" path="*.html" verb="*" modules="ServerSideIncludeModule" resourceType="File" requireAccess="Script" /> </handlers> </system.webServer> </configuration> Whilst we're on the topic, Robert McMurray (MSFT IIS staffer) has a fairly recent refresher blog post all about SSI's here: http://blogs.iis.net/robert_mcmurray/archive/2010/12/28/iis-notes-on-server-side-includes-ssi-syntax-kb-203064-revisited.aspx

Categories : HTML

Specify page size in jquery datatable server side pagination
It may be that the server doesn't respect the iDisplayLength value. In this case you must also update the server side.

Categories : Javascript

How can I do a live-updating web page without server-side scripting access?
It can be done using XMLHttpRequest, as long as both HTML files will be stored in the same location (to avoid CORS constraints). Have a look at this MDN article for examples on how to use XMLHttpRequest. The high-level view would be: // live webpage var xhr = new XMLHttpRequest(); xhr.onload = function () { /* parse xhr.repsonseText */ }; xhr.onerror = function () { /* ... */ }; xhr.open('get', 'server-updated-page.html', true); xhr.send();

Categories : Javascript

SSRS - Display current grouping field values in report page header
It turns out that the PageName property that I assigned at the group level is also available as a global field. If you add a text box to the page header and open its expression dialog, you will find a field in the Built-in Fields category called "PageName". Double-clicking this will add the following expression: "=Globals!PageName" That does it!

Categories : Reporting Services

How to implement "check all" functionality on different pages that checks only current page data in jquery datatable?
You could use the drawback function for this, to save the pageNumber and the checkbox status in an array or something, and check or uncheck: Like this: (Care, this fires not only on page change) $("#example").dataTable({ "fnDrawCallback": function( settings ) { .... } }); or width this: $("#example").on("page", function() { ... }); I hope it helps

Categories : Jquery

want to include one html page to another page in the client-side
First of all change the extension of all the pages from "html" to "shtml". Create an HTML Page having your header. And now what you can do it you can include your header into any shtml page by the following command <!--#include virtual="Web/Controls/TopPanel.html" --> The only thing which is the prerequisite is the SSI(Server Side Injection) should be supported by the server.

Categories : HTML

is it possible to keep the checked values of radio button should be same when we move from current page to previous page in php?
You can do this with JavaScript or jQuery... HTML One of my favorite ways to do a multi-page form, if your pagination doesn't need to create new (copy/pasteable) links, is to have pagination controls which invoke JavaScript to show & hide sections, like this: <div id='section1' class='section'> ... BUNCH OF RADIOS ... </div> <div id='section2' class='section'> ... BUNCH OF RADIOS ... </div> <div id='links' style='display:none;'> <a href='javascript:void(0);' class='show' data-section='1'>1</a> | <a href='javascript:void(0);' class='show' data-section='2'>2</a> </div> JavaScript Then, create some JavaScript functions (I'm assuming you have jQuery installed, if you don't, you can do this with pure Javascript but

Categories : PHP

Ajax in Rails, it doesn't work because it jumps to other page without staying in current page.
If you have jquery rails in your gemfile (gem 'jquery-rails') and have: //= require jquery //= require jquery_ujs in your application.js, what you've got there should work. Minus the show.js.erb, which would require you changing the data-type to be script instead of html. Although based on your description, the show.js.erb wouldn't be needed. The script you have in index.html.erb will suffice.

Categories : Ruby On Rails

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

PHP form reloads current page on POST action, rather than displaying 'success.php' page. Why?
To combine my two comments above... what I would try first is to replace $insertGoTo with an absolute value (ie http://www.mydomain.com/success.php) and then replace the last line (for the sake of cleaning it up) with: header("Location: $insertGoTo");. See if that works?

Categories : PHP

window.location.href inserts new page inside of current page
It's usually used as follows: window.location.href = "newpage.html" href is NOT a function, but a property. References: https://developer.mozilla.org/en-US/docs/Web/API/window.location I think you may have been confused with window.location.assign("http://whatever") method Caveat: href(url) may work on some browsers (IE???), but definitely not in FireFox - it gives an explicit "Not a function" error when run via JS-Execute

Categories : Javascript

Using jQuery to load page into a div element and remove current loaded page
Try cleaning the previous content. See if this works: $(document).ready(function() { $("#content-loaded").load("index.php"); $('.about').click(function(evt) { $("#content-loaded").empty(); $("#content-loaded").load("about.php"); evt.preventDefault(); }); //.... });

Categories : Jquery

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

Urldecode bug: after adding a simple product to shopping cart on search page and redirect to current page
In this fle appcodecoreMageCoreHelperAbstract.php public function escapeUrl($data) this function is responsible for weird url. It use htmlspecialchars function of php whic replace & with '&amp;' see here http://php.net/manual/en/function.htmlspecialchars.php So what I do is comment this line $this->getResponse()->setRedirect($returnUrl); in my CartController _goBack method insrtead of I used my custom redirect method.

Categories : Magento



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.