When I type something in the address, the google suggestion service is offering an autocomplete.
I would like to write my own autocomplete... I tend to use yubnub and I need my own commands with autocomplete.
How can I do that?
Please advise,
Thanks,
-hbt
I use a variation of this code:
http://www.codeproject.com/KB/aspnet/Search_SuggestTextBox.aspx
Essentially, every time a key is pressed in the box, an ajax call is made and the textbox's value is passed to a PHP page that parses the typed text, makes sense of it, and displays a drop-down-like box that gives you selection options.
You can see my implementation on this page:
http://www.needthishere.com/index.php
Once the page loads, type a zip code in the appropriate box. This technique can be used for an type of auto-complete-lookup-type functionality.
Currently there isn't a way to hook into Chrome's address bar (called the Omnibar by the Chrome team) but there is a proposed extension API:
https://docs.google.com/a/google.com/Doc?docid=0AYUOdFfLVYFRZGZqNnQ2N2RfODFnMzg2a2NmZA&hl=en
This API would let you get events when then user types into the Omnibar, and return suggestions that would be displayed in the autocomplete section.
Currently, this is enabled as an experimental API, so you can probably start playing with it:
http://code.google.com/chrome/extensions/dev/experimental.omnibox.html
You'll need to follow these directions on how to enable experimental APIs for extension development:
http://code.google.com/chrome/extensions/dev/experimental.html
I haven't used this API myself, but it would be good to get any feedback you might have if you do wind up writing something. The best place for that would be to send a message to the Chromium extensions discussion group: http://groups.google.com/a/chromium.org/group/chromium-extensions/topics
Related
I am refactoring some script code that is attached to the Fax Activity Entity in Microsoft Dynamics. In the script code I see:
document.getElementById("regardingobjectid").setAttribute("defaulttype", "2");
From what I understand, accessing the DOM from a Web Resource is unsupported in Dynamics. I would like to change this code to be something like the following:
Xrm.Page.getAttribute("regardingobjectid").setValue({defaulttype: 2})
Unfortunately, I can't find any documentation regarding setting the defaulttype property for the regardingobjectid field. I see some things about setting other properties, but none specifically for regardingobjectid. How can I set the defaulttype in a supported way?
You are correct that code is unsupported and should be avoided.
The regarding (regardingobjectid) field is a lookup field which allows many different entity types; contact, account, etc.
When a user opens the Look Up Record popup via 'Look Up More Records' link, it will display the default entity (account) first. The user can manually select a different entity type, but that requires more clicks.
In this case I believe the previous coder is trying to change the default entity type to contact. Google .setAttribute("defaulttype", "2") and there are plenty of hits describing the process.
I'm not 100% sure if there is a supported way to achieve this. Googling suggests there are a number of people trying to achieve this behaviour and struggling. There is a feature request open for this type of behaviour.
That said I believe using setDefaultView should work (MSDN).
Xrm.Page.getControl("regardingobjectid").setDefaultView("{00000000-0000-0000-00AA-000010001003}");
Where the Guid is the id of a contact view.
Related; Lookup contacts instead of accounts on emails in MS Dynamics CRM 2013
I am just very new to Tealium tagging and I want to use the tags whenever an error comes at the loading of a page.
I am using subscribe-publish for showing the error on screen. Now I want to send the error information for analytics purpose everytime an error comes.
Want to send info like error type, page name, site name etc.
Can you please help how to have this implemented using tealium? Please start the explanation from the very basics as I am literally just a beginner :P
Thanks in advance.
First, the asynchronous Tealium script would need to be included on the page.
Create the UDOs for each of the elements you're planning to capture information about (e.g. "error_type", "page_name", "site_name", etc) and consider adding some friendly aliases. These will be the values you need to populate the data layer with when such an error occurs. At this point, assuming you're using the default data layer name of "utag_data", your page will need to have the following JavaScript in the data layer object on the page before the Tealium script is referenced:
utag_data = {
"page_name": "my webpage",
"error_type": "bad request",
"site_name": "my website"
}
Add a tag for the analytics solution you wish to use and set up the appropriate dimensions/variables you wish to store the information within. This usually involves opening the mapping control within the tag, picking the variable you wish to store the information in and mapping it to your UDO that you created previously. Ensure that any analytics-side mapping is done as well since you may need to explicitly define what sort of information you're sending in.
At this point, you just need to save and publish to the environment you're planning to capture the data within (though testing in a staging environment is a good idea too). When you visit the page and there's an error, assuming you did the above, you should see the network request in your browser's developer tools going to the analytics system with the data you provided.
I'm playing around with Apache Cordova and I want to implement a search box that can search in a list or something similar (local database?). I want it to be local so that the app does not require an internet connection to search.
The way I want it to be set up is that it need to be able to search for both the name of the item and a number.
Example 1:
A user searches for: "Honda". He will then be sent to a page where information about "Honda" will be diplayed.
Example 2:
A user searches for the id: "1337". He will then be sent to the page containing information about "Honda".
So "Honda = 1337" and "1337 = Honda" if you guys understand?
The question:
I'm wondering what solution would suite my needs for this project?
or there any frameworks out there for this?
Thanks in advance!
It depends on what you want to have the search box and submit to be like.
One way is to use this really great tool http://ivaynberg.github.io/select2/ it can load data from database (using either ajax or load all of your data and only filter them) and shows them in selectbox. You can have submit button or something like that next to your selectbox.
Other way might be to use http://www.datatables.net/ it has search box, which can load data to table using ajax where you can have additional information and submit button for sending user to specific page.
There is plenty of other tools for this kind of problem, I used these two and I can say
I'm trying to figure out how to get the location of someone filling out a web form on my site. I just want to get it down to a state level for US and Country for international(although state or equivalent is fine international too). I just don't want the user to have to select from a super long list or fill out a field. So ideally something like a hidden field that could have javascript or php pass the info to it.
Any ideas?
You can try; http://www.w3schools.com/html/html5_geolocation.asp
And using Google API:
http://maps.googleapis.com/maps/api/staticmap?zoom=10&size=400x400&maptype=roadmap&markers=color:red%7Ccolor:red%7Clabel:C%7Cxx.xxxxxxx,xx.xxxxxxx&sensor=false
Using PHP or Javascript to replace the "xx.xxxxxxx"'s will give you a map of the users location.
You can probably use Google API to determine the users State, etc - as you mentioned. But I don't think you will be baby fed on this one.
You could try to figure out their location using their IP address. However, this is far from reliable. Unfortunately, if you need this data to be accurate, you're going to have to get them to give you their location.
Is there an easy way to let users update their status on Facebook with a message I have in a JavaScript variable? I know there's a URL you can use to share a link, which looks like:
testlink
That doesn't fill in a status update when it takes them to the share page. Is there a way I can have that pre-filled, or have their status automatically updated?
Thanks!
Edit: Not quite what I'm going for. I can use PHP if necessary (although I have very little experience with it), but I don't want to have to bug users with allowing an application, or have to deal with actually writing a facebook app. I just want to give users a premade status update, so all they have to do is click the 'share' button. Thanks again!
Edit 2: So the api looks promising, but a little complicated for me. It looks like it would involve getting permission from the user to set their status, and possibly something about setting up a cross-communications channel to let my site communicate with facebooks. Assuming I can do that, how do I go about using the Facebook Javascript api? I get the code (user_setStatus looks easy enough), but how do I tell my script that I'm using Facebook's api? Thanks again...again!
Try this:
http://www.facebook.com/connect/prompt_feed.php?&message=my%20awesome%20status
[EDIT]
Link is not working please update it.
Is the facebook javascript API not what you're looking for? It seems to expose the entire REST-ful API as a javascript library.
users_setStatus(...) looks promising.
Not sure if you're using PHP but here's a link that shows you how to use the Facebook API to update the status. You could call a page with Ajax from Javascript, passing in the variable and have that posted to the Facebook status message.
http://fbcookbook.ofhas.in/2009/02/07/facebook-reveals-status-api-how-to-use-it/
Using just mcqwerty solution you'll get an annoying resize screen effect.
But, you can add a parameter in order to avoid this flickering. Display touch will avoid this.
https://www.facebook.com/connect/prompt_feed.php?display=touch&message=Hiall
Here is working example which requires application ID, but fully working and it is easy to implement:
<a href="http://www.facebook.com/dialog/feed?app_id=123050457758183&link=http://www.build.server.com&picture=http://fbrell.com/f8.jpg&
name=Some%20Encoded&Message=Reference%20Documentation&
description=Using%20Dialogs%20to%20interact%20with%20users.&
redirect_uri=https://arapskirjecnik.web44.net/"> Share with FB</a>
see more here
here is the way which works and it doesn't requires facebook application id:
<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&p[title]=Title&p[summary]=summary&p[url]=www.build.server.com&p[images][0]=http://fbrell.com/f8.jpg','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)">Insert text or an image here.</a>
As you can see from above code you can enter custom title, summary, link and images.
and if you want to automate, to share current link, youst replace this part of the code in upper example:
p[url]='+ document.URL +'&p[images]