w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
I am trying to create a link on an HTML page using information that a user inputs via JavaScript alert box
What you have is almost correct. var favoriteSiteName = '', favoriteSiteURL = ''; favoriteSiteName = prompt('What is your favorite web site?'); favoriteSiteURL = prompt('What is the URL of that site?'); document.write('<a href="' + favoriteSiteURL + '">' + favoriteSiteName + '</a>'); You were missing the semi-colons to indicate the end of the lines and adding the site name to the link. Also, the h1 and h2 elements don't belong inside the script element. JSFiddle.

Categories : Javascript

Adding slash / after any link in my site opens the page without any images
In your html content, you need to either change your relative links (ones that don't start with a /) to absolute links (ones that start with a /) or create a relative URI base in the <head> portion of your page: <base href="/">

Categories : Htaccess

c# WPF button link to user control page
<asp:TextBox ID="txtName" runat="server"></asp:TextBox> <br /> <asp:Button ID="Button1" runat="server" Text="Next" onclick="Button1_Click" /> Page1.aspx.cs protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["Name"] != null) txtName.Text = Session["Name"].ToString(); } } protected void Button1_Click(object sender, EventArgs e) { Session["Name"] = txtName.Text; Response.Redirect("Page2.aspx"); } Page2.aspx <asp:Button ID="Button1" runat="server" Text="Back" onclick="Button1_Click" /> Page2.aspx.cs protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("Page1.aspx"); }

Categories : C#

How do I hide Admin link in master page until user logs in?
Set visible to false in markup. Add runat="server" to the element. Set visible to true in code behind once authenticated. <div class="footer" id="divAdmin" Visible="False" runat="server"> <ul> <li><a href="~/admin.aspx">Administration Page</a></li> </ul> </div> If Session("UserRole") = 1 Then divAdmin.Visible = True End If

Categories : Asp Net

Take all user entered data from one jsp page to another JSP page and after user confirmation submit it from the first jsp page
Create a form with all the fields you require. Submit that form. set the action to the target jsp. In the request object of target jsp you will get all the data you entered. You can specify the action like this form id="login-form" action="Your action jsp url"

Categories : HTML

Android twitter user/show (user information) migration version 1 to 1.1
I have solved my problem by sending authentication with api. In api version 1.1 we need to send authentication with request otherwise we get 400 bad request(invalid request). This is the coding example for sending authentication. private OAuthConsumer consumer; consumer = new CommonsHttpOAuthConsumer( Constants.CONSUMER_KEY, Constants.CONSUMER_SECRET); consumer.setTokenWithSecret(token,secret_token); .......... HttpGet httpGet = new HttpGet(params[0]); consumer.sign(hpost); we need sign-core and sign common post jars.

Categories : Android

Highlight anchor link when user tabbs to link from a text input box
Do it using focus and hover a:hover {background:yellow; color:navy;} a:focus {background:yellow; color:navy;} Here is a demo http://jsfiddle.net/kevinPHPkevin/s8Rdu/1/

Categories : CSS

DRY approach to add user information without using Auth.user in Django
I would recommend using a dummy value in either the date_joined or last_login fields for the User model, if you wanted to implement a solution without adding a new field just to serve as an indicator flag. The potential problem with using the is_active flag is that you may end up wanting to use this flag to "blacklist" or effectively delete an account without actually removing their record from your database (to prevent re-creation of the account with same credentials, etc.) If you start relying on the fact that the password is not set, then if the day ever comes where you want to implement alternative login methods (OAuth) then your password field will not be set in these cases as well (huge conflict).

Categories : Django

Create Link for visiting site as registered user. But this link will have expire date(example 3 days)
Very simple. When the user creates the link, capture the datetime and save it in a database. When ever the link is clicked, check if the age of the link is older than 3 days. If it is, deactivate the link and/or remove it. This is the easiest way. Another way is to have a process running which will check and automatically disable the link after 3 days. This is usually more difficult to achieve though.

Categories : Asp Net Mvc

how get user locale in jsp page when he visit website and display page in user language
Write an HttpFilter to handle this and map it in web.xml. if(request.getParameter("language")==null) { String userLocale = request.getHeader("Accept-Language"); Locale locale = request.getLocale(); if(req.getRequestUrl().contains("?")) { response.sendRedirect(req.getRequestUrl()+"&language="_locale.getLanguage()); } else { response.sendRedirect(req.getRequestUrl()+"?language="_locale.getLanguage()); } }

Categories : Java

Send page title, page URL, link title and link href, with Ajax
I would write it like this: $("a").click(function () { $.post( 'http://counter:8888/sts/click.php', { id: $(this).data("linkid"), htmltitle: (document.title + " <br/> " + '(' + document.location.href + ')'), clicktitle: $(this).attr("title") + " <br/> (" + $this.attr("href") + ")"; }); }); And then do my markup like this: <a href="http://google.com" data-linkid="1" title="google1">google 1</a> <a href="http://fb.com" data-linkid="2" title="fb 2">fb 2</a>

Categories : Jquery

jQuery fading "back to top" link. Page load link visibility
I tested the code below and it worked without problems <!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { // hide #back-top first $("#back-top").hide(); // fade in #back-top $(function () { $(window).scroll(function () { if ($(this).scrollTop() > 500) { $('#back-top').fadeIn(); } else { $('#back-top').fadeOut(); } }); // scroll body

Categories : Javascript

Whole page scrolls down by clicking link directed to inside link in iframe
try the following: $("#pr1").click(function(e){ e.preventDefault(); $("#content").html('<iframe id="idIframe" src="research/index.html#pr1" frameborder="0" height="100%" width="98%"></iframe>');

Categories : Jquery

Link to exact page in Wordpress mobile site by changing url in link
If you have no www. prefix, you can do it with JavaScript this way: href="javascript:window.location.href = window.location.href.replace('//', '//m.');void(0)"

Categories : PHP

Pass the information of tags to the php and display in another page( and can also update in another page)?
First of all the jsfiddle link doesn't work for me. Now, the only way is to use http methods like POST/GET to pass the data from client to server. The implementation depends of what you like the most or better a friendly and easy to use interface, so my suggestions are: You can create (dynamically or not) a form (with hidden fields for example) and update their values with JS and pass the data through a submit button which is an easy implementation. An another implementation is to use Ajax if you take care of user selection and create the data structure dynamically. In both cases, you should validate the correctness of the submitted data with php. Never trust the user or the "supposed" JavaScript restrictions.

Categories : PHP

Redirecting Mediawiki User Page and User Talk page to external url
Can someone have a look at the above code and let me know if I've got something wrong or if this cannot be done? Yes, your Redirect directive is wrong. It isn't a regular expression and thus you can't have stuff like * in it, unless you're actually trying to match against a "*". You're probably not going to be able to do the redirect from the htaccess file in your root directory as Mediawiki uses its own htaccess. So in the htaccess file that's in the /wiki/ folder, try adding this above any rewrite rules that are already there: RewriteCond %{QUERY_STRING} ^title=User:([^&]+) [NC] RewriteRule ^ /memberlist.php?mode=viewprofile&un=%1 [L,R=301] That should take care of the URLs that look like: /index.php?title=User:XYZ RewriteRule User:(.*)$ /memberlist.php?mode=viewprofile

Categories : Htaccess

How to use an html form to gather information to create a link
Try writing a dynamic web page where the link in the HTML is constructed on the server-side based on the information provided in your form on the previous page. Some popular dynamic web page languages are JSP, ASP, and PHP. Note that dynamic web pages have to be hosted on a web server.

Categories : HTML

How to link to the kth link on another web page in simple html?
You cannot do this with pure HTML. You will need either Javascript or server-side code, in which you retrieve the source of Reddit's homepage, parse it to pick out the link you want, and use its href attribute's value as the href value for your own link.

Categories : HTML

How to refresh the web page on all user's interface when some user make changes to that page?
A simple way would be Save a random string(token) on the Server and deliver it to every web page Inside the web page run a js-script(Ajax), which ask the Server for the token - if a new token is returned, refresh the page if you want to refresh all the pages, just set a new token

Categories : PHP

ANDROID:How to fetch information from this link http://api.discogs.com/artist/ac/dc?
Ok, your question is bit confusing basically, the link to me only produces XML, it's pretty standard stuff, although bizarrely If i request say http://api.discogs.com/ I only get JSON data, this doesn't matter even if I make the request with a content type of 'application/xml' and vice versa with the provided url and a content type of 'application/json'. What you need to do is in your responses from the HTTP requests look at the content type of the body being returned, if it's 'application/xml' use your XML parser, if it's 'application/json' then use a JSON parser. I can't say much more than this with out documentation of the site about what it's meant to provide. Ideally if you can use all JSON then you should it's better for mobiles to consume over XML. An example of how to parse JSON

Categories : Android

Scrapy parsing of the hidden information appearing after link click
I did not understand very well if what you're trying to get is to show some info inside the a tag or in other part of the page. But in any of the cases that will also depend on what does the showInfo() function return. If the first case is what you need and showInfo() returns the text with the info, i believe this is what you're looking for: <a id="showInfoBtn" rel="nofollow" title="SomeTitle" href="#" onclick="this.innerHTML=showInfo(event)"> Info showed here after click </a> Here's a demo with the example http://jsfiddle.net/P49Dv/ ;)

Categories : Javascript

Adding information from variables to database PHP
Replace echo $row2['first_name']; with return $row2['first_name'];. If you want to get some value from the function, you should use return operator to pass the value back. It has nothing to do with printing the value with print or echo.

Categories : PHP

Dynamically Adding Information to Fragments
When creating a Fragment, create public methods to set data: public class MyFragment extends Fragment { private TextView text1; private TextView text2; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View layout = LayoutInflater.from(getActivity()).inflate(R.layout.simple_list_item_2,container,false); text1 = (TextView) layout.findViewById(R.id.text1); text2 = (TextView) layout.findViewById(R.id.text2); return super.onCreateView(inflater, container, savedInstanceState); } public void setData(String t1, String t2){ text1.setText(t1); text2.setText(t2); } } When adding a fragment in parent activity, give it a unique tag: MyFragment f = new MyFragm

Categories : Android

Beforeunload is not working to redirect user to another page, how can I redirect user to another page/url when he attempts to close a window/tab?
*Don't do it* But it is possible with the user's permission; you can achieve something like this (took me a while to find a website that was happy in a frame) window.onbeforeunload = function () { window.setTimeout(function () { // escape function context window.location = 'http://bbc.co.uk'; }, 0); window.onbeforeunload = null; // necessary to prevent infinite loop // that kills your browser return 'Press "Stay On Page" to go to BBC website!'; // pressing leave will still leave, but the GET may be fired first anyway } Demo

Categories : Javascript

Adding information to pdf, PyPDF2 merging too slow
Since all you are doing is adding some text to the page, you can probably speed up the process by just editing the pages' content streams directly. Merging has to deal with fonts, other resources, crop boxes, etc. that slow down the process significantly. If you actually need to modify some of these things, the solution becomes more complex. Some example code: TEXT_STREAM = [] # The PS operations describing the creation of your text def add_text(page): "Add the required text to the page." contents = page.getContents() if contents is None: stream = ContentStream(TEXT_STREAM, page.pdf) else: contents.operations.extend(TEXT_STREAM)

Categories : Python

Adding arbitrary information to createElement object
You can use the html5 data attribute to add arbitrary data to DOM elements. btn.setAttribute('data-array','one,two,three'); Get the data back by using split; Here's an example: jsFiddle

Categories : Javascript

How to get a different link color on my tumblr static page then my main (front page?)
It's not working because you're not actually targeting the anchor tag in your second style declaration. Try: #page #list a { color: #fff; /* white */ } This won't change the hover state, but it will change the color. To change the hover state you'll have to target that specifically to override the generic a:hover you've defined above. You'll also want to define the ':visited' styles, otherwise you might not see these changes reflected (because the link has already been visited). #page #list a:visited { color: #fff; /* white */ } Or you could define all of the states in one block, assuming they're supposed to have identical styles. #page #list a, #page #list a:visited, #page #link a:hover, #page #list a:active { color: #fff; /* white */ } In case it's not clear, the

Categories : HTML

How can I create a link to page and load specific content in iframe on that page
you'd have to add an iframe to http://xxx.xxx.com/page like this: <iframe src="http://xxx.yyy.com/anotherpage"></iframe>

Categories : HTML

Rails Model user adding player to user pinboard
Try: has_many :pins, through: :pin_boards, source: :players The key is to make the source be the exact same as the relationship in the join model. So, since your join model (PinBoard) almost certainly says has_many :players then you have to match that word players exactly. So you were just missing the 's'.

Categories : Ruby On Rails

Adding row and column in a multidimensional array if a new information is being added
I would suggest you to replace the Multidimensional Array with a Dictionary (see this) Using Dicitonary<K, V> you will be able to add "new rows" (KeyValuePairs<K, V> (see this) to be precise), find, remove and modify. They are represented with a unique Key that will give you a value. For example: public class Program { public void Main() { Dictionary<int, Meeting> meetingDictionary = new Dictionary<int, Meeting>(); //`int` on the left will be the key, and `Meeting` on the right is the value //int represents a unique Id of the meet event. //To add a new meeting: var date = new DateTime(2013, 7, 21); //date representor of the meet var meetingA = new Meeting("Obamba Blackinson", date); //object

Categories : C#

pagination codeigniter always starts at page 2 and active link is always at page 2
try a different way of solution, controller(index()) $this->load->library('pagination'); $config['base_url'] = site_url().'classname/index'; $config['per_page'] = $this->config->item('pagination_number'); $config['uri_segment'] = 4; $data['count']=$this->example_model->count(); $config['total_rows'] =$data['count']; $data['classname']=$this->example_model->getall($this->config->item('pagination_number'),$this->uri->segment(4)); $this->pagination->initialize($config); $data['page_link']=$this->pagination->create_links(); $this->load->view('users/classname.php',$data); model function getall($num,$offset) { $this->db->from('table_name'

Categories : Codeigniter

Adding PHP code to Drupal Page for adding Javascript
This is more typically handled via a custom module or theme function. But assuming this is being put into a field on a node your code should work. The issue is likely a text format setting. Assuming this is Drupal 7, you can go to /admin/config/content/formats. I assume you are using PHP format. So you will want to inspect the settings for this format and make sure the PHP filter is enabled.

Categories : PHP

Adding aditional information for logging data with enterprise library
You can add the additional information to the Exception.Data property. These values will be added to the LogEntry's ExtendedProperties. You can then configure the formatter to output the specific Extended Property keys in the formattedMessage string. See: Exception.Data info is missing in EntLib log That's probably the easiest way but then the information is buried within a string in the database table. Another approach would be to add the data directly to the database. This will involve changes to the out of the box database schema and stored procedures as well as creation of a custom trace listener. You can find two different designs at the Enterprise Library Sample Projects page: The Extended Properties Trace Listener with Custom Exception Handler contains a custom trace listen

Categories : C#

Scroll to div smoothy on page 2 - after clicking on a link on page 1?
Run this code when being_at_mall.html file loads $(function () { $(document.body).animate({ scrollTop: $(location.hash).offset().top }, { duration: 'slow', easing: 'swing' }); }); Demo You can see in the demo that it scrolls when the page loads. The above code uses location.hash which will give you #article i.e. the id to the element in being_at_mall.html. Also this page* lists more options on how to scroll smoothly along with demo. * I'm the author of that page. I created that when I was learning jQuery.

Categories : Jquery

Post link to Facebook page as page admin
You need to use a Page access token if you want the post to appear 'as the page' - if you use your user access token the behaviour depends on some settings in the page management interface of Facebook and may or may not post as the page depending on those settings.

Categories : C#

Redirect to the link page after the page has fully loaded
As far as I know, the only way to achieve this is to use AJAX to load your content. That is, instead of reloading the entire page for every link, you just reload portions of content depending on what link was clicked. Let's say your page has a container like this: <div id="content">...</div> Then, for every link (matching a certain condition if you don't want it to happen for all the links), you execute an AJAX request similar to $("a").click(function() { $this = $(this); var data = {}; // Put additional parameters here $.get($this.attr("href"), data , function(response) { $("#content").html(response); } } As @rofavadeka has mentioned, you can also modify the URL so that it reflects the change of location, using something like: window.history.

Categories : Javascript

How to get all user information from twitter with api v1.1?
You can use this link FHSTwitterEngine and check the code given in answer.. FHSTwitterEngine is latest library with compatible with v1.1.. its should solve your problem

Categories : Iphone

Get user information in Windows 8?
@seshuk had given you the correct answer, from the MSDN documentation Only domain users have a principal name. Access to the principal name can be blocked by privacy settings (for example, if the UserInformation::NameAccessAllowed property is false). If access is blocked, this method returns an empty string. This method requires the enterpriseAuthentication capability. A Hotmail id, by definition, would not be a domain user. Additionally, you'd need a company account to publish such an app, since it requires the enterprise authentication capability.

Categories : C#

How can I make a quick edit text link to auto fill form information from a mysql database
Use a string to hold selected number,use the stored value in the string to search for the required row.Use another string to pull the information from the database and use # to split the columns.Save each column to a specific string which you will assign to where the value should be auto filled.

Categories : PHP

Retrieving information of validated user in WCF
If you are using the WCF in web application you can store the user details in cookie as the CodeProject article does or you can follow WCF Authentication as here: msdn.microsoft.com/en-us/library/ff405740.aspx Use below code to get user: var currentUser = new WindowsPrincipal((WindowsIdentity) System.Threading.Thread.CurrentPrincipal.Identity);

Categories : C#



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